Update laborious/worker/worker.py
This commit is contained in:
@@ -141,10 +141,19 @@ async def main():
|
|||||||
metrics_controller=metrics_controller,
|
metrics_controller=metrics_controller,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if runtime == 'legacy':
|
||||||
|
to_install_runtime = 'single'
|
||||||
|
else:
|
||||||
|
to_install_runtime = runtime
|
||||||
|
|
||||||
try:
|
try:
|
||||||
await plugin_store.install_runtime(runtime_name=runtime, metadata=metadata_runtime)
|
await plugin_store.install_runtime(
|
||||||
|
runtime_name=to_install_runtime, metadata=metadata_runtime
|
||||||
|
)
|
||||||
except Exception as exc:
|
except Exception as exc:
|
||||||
logger.custom_critical(f'Failed to install runtime {runtime}: {exc}', metadata_runtime)
|
logger.custom_critical(
|
||||||
|
f'Failed to install runtime {to_install_runtime}: {exc}', metadata_runtime
|
||||||
|
)
|
||||||
metrics.APP_UP.labels(pod_id=POD_ID).set(0)
|
metrics.APP_UP.labels(pod_id=POD_ID).set(0)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
@@ -207,6 +216,7 @@ async def main():
|
|||||||
activities.export_data_to_postgres,
|
activities.export_data_to_postgres,
|
||||||
],
|
],
|
||||||
logger=logger,
|
logger=logger,
|
||||||
|
runtime='core',
|
||||||
),
|
),
|
||||||
prepare_worker(
|
prepare_worker(
|
||||||
temporal_client=temporal_client,
|
temporal_client=temporal_client,
|
||||||
@@ -219,6 +229,7 @@ async def main():
|
|||||||
activities.export_data_to_postgres,
|
activities.export_data_to_postgres,
|
||||||
],
|
],
|
||||||
logger=logger,
|
logger=logger,
|
||||||
|
runtime='core',
|
||||||
),
|
),
|
||||||
prepare_worker(
|
prepare_worker(
|
||||||
temporal_client=temporal_client,
|
temporal_client=temporal_client,
|
||||||
|
|||||||
Reference in New Issue
Block a user