Allow run dir to exist
This commit is contained in:
parent
f785527156
commit
9046f448ac
@ -142,7 +142,7 @@ RPCConnection.register_location(config.get('SIGNER_SOCKET_PATH'), chain_spec, 's
|
|||||||
|
|
||||||
Otx.tracing = config.true('TASKS_TRACE_QUEUE_STATUS')
|
Otx.tracing = config.true('TASKS_TRACE_QUEUE_STATUS')
|
||||||
|
|
||||||
liveness.linux.load(health_modules)
|
liveness.linux.load(health_modules, namespace='cic-eth')
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
argv = ['worker']
|
argv = ['worker']
|
||||||
@ -178,9 +178,9 @@ def main():
|
|||||||
connect_declarator(rpc, chain_spec, trusted_addresses)
|
connect_declarator(rpc, chain_spec, trusted_addresses)
|
||||||
connect_token_registry(rpc, chain_spec)
|
connect_token_registry(rpc, chain_spec)
|
||||||
|
|
||||||
liveness.linux.set()
|
liveness.linux.set('cic-eth')
|
||||||
current_app.worker_main(argv)
|
current_app.worker_main(argv)
|
||||||
liveness.linux.reset()
|
liveness.linux.reset('cic-eth')
|
||||||
|
|
||||||
|
|
||||||
@celery.signals.eventlet_pool_postshutdown.connect
|
@celery.signals.eventlet_pool_postshutdown.connect
|
||||||
|
@ -35,7 +35,7 @@ def load(check_strs, namespace=default_namespace, rundir='/run', *args, **kwargs
|
|||||||
logg.info('liveness check passed: {}'.format(str(check)))
|
logg.info('liveness check passed: {}'.format(str(check)))
|
||||||
|
|
||||||
app_rundir = os.path.join(rundir, namespace)
|
app_rundir = os.path.join(rundir, namespace)
|
||||||
os.makedirs(app_rundir) # should not already exist
|
os.makedirs(app_rundir, exist_ok=True) # should not already exist
|
||||||
f = open(os.path.join(app_rundir, 'pid'), 'w')
|
f = open(os.path.join(app_rundir, 'pid'), 'w')
|
||||||
f.write(str(pid))
|
f.write(str(pid))
|
||||||
f.close()
|
f.close()
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
from setuptools import setup
|
from setuptools import setup
|
||||||
setup(
|
setup(
|
||||||
name='liveness',
|
name='liveness',
|
||||||
version='0.0.1a5',
|
version='0.0.1a6',
|
||||||
packages=['liveness'],
|
packages=['liveness'],
|
||||||
include_package_data=True,
|
include_package_data=True,
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user