Allow run dir to exist

This commit is contained in:
nolash 2021-04-19 14:49:48 +02:00
parent f785527156
commit 9046f448ac
Signed by untrusted user who does not match committer: lash
GPG Key ID: 21D2E7BB88C2A746
3 changed files with 5 additions and 5 deletions

View File

@ -142,7 +142,7 @@ RPCConnection.register_location(config.get('SIGNER_SOCKET_PATH'), chain_spec, 's
Otx.tracing = config.true('TASKS_TRACE_QUEUE_STATUS')
liveness.linux.load(health_modules)
liveness.linux.load(health_modules, namespace='cic-eth')
def main():
argv = ['worker']
@ -178,9 +178,9 @@ def main():
connect_declarator(rpc, chain_spec, trusted_addresses)
connect_token_registry(rpc, chain_spec)
liveness.linux.set()
liveness.linux.set('cic-eth')
current_app.worker_main(argv)
liveness.linux.reset()
liveness.linux.reset('cic-eth')
@celery.signals.eventlet_pool_postshutdown.connect

View File

@ -35,7 +35,7 @@ def load(check_strs, namespace=default_namespace, rundir='/run', *args, **kwargs
logg.info('liveness check passed: {}'.format(str(check)))
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.write(str(pid))
f.close()

View File

@ -1,7 +1,7 @@
from setuptools import setup
setup(
name='liveness',
version='0.0.1a5',
version='0.0.1a6',
packages=['liveness'],
include_package_data=True,
)