Rehabilitate server runnable
This commit is contained in:
parent
a4fcb6d640
commit
930faef213
@ -6,7 +6,7 @@ data_dir =
|
|||||||
|
|
||||||
[database]
|
[database]
|
||||||
engine =
|
engine =
|
||||||
name = chaind_eth
|
name = chaind
|
||||||
driver =
|
driver =
|
||||||
user =
|
user =
|
||||||
password =
|
password =
|
||||||
|
@ -115,7 +115,7 @@ chain_spec = ChainSpec.from_chain_str(config.get('CHAIN_SPEC'))
|
|||||||
dsn = dsn_from_config(config)
|
dsn = dsn_from_config(config)
|
||||||
backend = SQLBackend(dsn, debug=config.true('DATABASE_DEBUG'))
|
backend = SQLBackend(dsn, debug=config.true('DATABASE_DEBUG'))
|
||||||
adapter = EthAdapter(backend)
|
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):
|
def process_outgoing(chain_spec, adapter, rpc):
|
||||||
@ -123,6 +123,7 @@ def process_outgoing(chain_spec, adapter, rpc):
|
|||||||
session = adapter.create_session()
|
session = adapter.create_session()
|
||||||
r = dispatcher.process(rpc, session)
|
r = dispatcher.process(rpc, session)
|
||||||
session.close()
|
session.close()
|
||||||
|
return r
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
@ -143,7 +144,7 @@ def main():
|
|||||||
break
|
break
|
||||||
if srvs == None:
|
if srvs == None:
|
||||||
logg.debug('timeout (remote socket is none)')
|
logg.debug('timeout (remote socket is none)')
|
||||||
process_outgoing(chain_spec, adapter, rpc)
|
r = process_outgoing(chain_spec, adapter, rpc)
|
||||||
if r > 0:
|
if r > 0:
|
||||||
ctrl.srv.settimeout(0.1)
|
ctrl.srv.settimeout(0.1)
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user