debug with print
Build and Publish / test (push) Successful in 2m11s
Build and Publish / build (push) Successful in 17s
Build and Publish / Build and Deploy Docs (push) Successful in 40s

This commit is contained in:
2026-06-30 16:49:15 +02:00
parent 51535239d0
commit cfa1cd669d
+7 -4
View File
@@ -80,32 +80,35 @@ async def lifespan(application: FastAPI):
each worker gets its own fresh Redis, BEC, EPICS, and TELL connections.
"""
global bl, cfg, daq
print(f"something!!!")
await asyncio.sleep(random.uniform(0.5, 3.0))
logger.info(f"Worker {os.getpid()} starting initialisation...")
# ── Core objects (Redis, EPICS PVs, BEC, TELL, JFJoch, etc.) ──
bl = mx_beamline()
print(f"something after bl!!!")
cfg = BeamlineConfig(bl)
print(f"something after cfg!!!")
daq = AareDAQ(cfg, bl)
print(f"something after daq!!!")
try:
cfg.reset_automation_progress()
except Exception as e:
logger.warning(f"Failed to reset automation progress Redis keys: {e}")
print(f"something after reset automation!!!")
try:
daq.refresh_detector_metadata_cache()
except Exception as e:
logger.warning(f"Initial hardware metadata refresh failed: {e}")
print(f"something after refresh detector metadata!!!")
# ── Initial TELL sync ──
try:
daq.sync_current_sample_from_tell(force=True)
except Exception as e:
logger.warning(f"Initial sample sync from TELL failed: {e}")
print(f"something after sync current sample!!!")
# ── Wire callbacks ──
daq.set_face_detection_progress_callback(_push_face_detection_progress)
daq.set_automation_progress_callback(_push_automation_progress)