Rehabilitate server runnable

This commit is contained in:
nolash 2021-07-19 12:47:17 +02:00
parent a4fcb6d640
commit 930faef213
Signed by: lash
GPG Key ID: 21D2E7BB88C2A746
2 changed files with 4 additions and 3 deletions

View File

@ -6,7 +6,7 @@ data_dir =
[database]
engine =
name = chaind_eth
name = chaind
driver =
user =
password =

View File

@ -115,7 +115,7 @@ chain_spec = ChainSpec.from_chain_str(config.get('CHAIN_SPEC'))
dsn = dsn_from_config(config)
backend = SQLBackend(dsn, debug=config.true('DATABASE_DEBUG'))
adapter = EthAdapter(backend)
rpc = EthHTTPConnection(url=config.get('RPC_ENDPOINT'), chain_spec=chain_spec)
rpc = EthHTTPConnection(url=config.get('RPC_HTTP_PROVIDER'), chain_spec=chain_spec)
def process_outgoing(chain_spec, adapter, rpc):
@ -123,6 +123,7 @@ def process_outgoing(chain_spec, adapter, rpc):
session = adapter.create_session()
r = dispatcher.process(rpc, session)
session.close()
return r
def main():
@ -143,7 +144,7 @@ def main():
break
if srvs == None:
logg.debug('timeout (remote socket is none)')
process_outgoing(chain_spec, adapter, rpc)
r = process_outgoing(chain_spec, adapter, rpc)
if r > 0:
ctrl.srv.settimeout(0.1)
else: