def init_worker(**kwargs): """ Configures each Celery worker process on process startup""" # logger.warning(f"init_worker") coro = db.startup( # creates connection pool per worker process pool_min_size=conf.CeleryConfig.db_pool_min_size, pool_max_size=conf.CeleryConfig.db_pool_max_size, ) util.aio.async_to_sync(coro)
"42383362090000", "42383374140000", "42383374130000", "42383362060000", ] ids = ["14207C0155111H", "14207C0155258418H"] ids = ["14207C0202511H", "14207C0205231H"] entity12s = {x[:12] for x in ids} hole_direction = HoleDirection.H # from db import db # import util # ! TEST PROD EXECUTOR util.aio.async_to_sync(db.startup()) async def async_wrapper(): if not db.is_bound(): await db.startup() async def test_well_horizontal_tiny_batch(): if not db.is_bound(): await db.startup() wexec = WellExecutor(HoleDirection.H) wellsets = [] for api14 in deo_api14h: try: # api14 = "42461411280000" wellset = await wexec.download(api14s=[api14])