Apply queue-specific settings to tasker cli

This commit is contained in:
lash 2022-04-26 21:30:13 +00:00
parent 3d39fea7f8
commit ab1977b802
Signed by: lash
GPG Key ID: 21D2E7BB88C2A746

View File

@ -56,15 +56,11 @@ config.add('eth', 'CHAIND_ENGINE', False)
logg.debug('config loaded:\n{}'.format(config)) logg.debug('config loaded:\n{}'.format(config))
settings = ChaindEthSettings() settings = ChaindEthSettings(include_queue=True)
settings.process(config) settings.process(config)
logg.debug('settings:\n{}'.format(settings)) logg.debug('settings:\n{}'.format(settings))
import sys
sys.exit(0)
def process_outgoing(chain_spec, adapter, rpc, limit=100): def process_outgoing(chain_spec, adapter, rpc, limit=100):
upcoming = adapter.upcoming() upcoming = adapter.upcoming()
@ -85,18 +81,18 @@ tx_normalizer = TxHexNormalizer().tx_hash
token_cache_store = CacheTokenTx(chain_spec, normalizer=tx_normalizer) token_cache_store = CacheTokenTx(chain_spec, normalizer=tx_normalizer)
dispatcher = EthDispatcher(conn) dispatcher = EthDispatcher(conn)
queue_adapter = ChaindFsAdapter( queue_adapter = ChaindFsAdapter(
chain_spec, settings.get('CHAIN_SPEC'),
config.get('SESSION_DATA_DIR'), settings.get('SESSION_DATA_DIR'),
EthCacheTx, EthCacheTx,
dispatcher, dispatcher,
) )
ctrl = SessionController(config, queue_adapter, process_outgoing) ctrl = SessionController(settings, queue_adapter, process_outgoing)
signal.signal(signal.SIGINT, ctrl.shutdown) signal.signal(signal.SIGINT, ctrl.shutdown)
signal.signal(signal.SIGTERM, ctrl.shutdown) signal.signal(signal.SIGTERM, ctrl.shutdown)
logg.info('session id is ' + config.get('SESSION_ID')) logg.info('session id is ' + settings.get('SESSION_ID'))
logg.info('session socket path is ' + config.get('SESSION_SOCKET_PATH')) logg.info('session socket path is ' + settings.get('SESSION_SOCKET_PATH'))
def main(): def main():
while True: while True: