debug with print
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user