UNI12345 commited on
Commit
dca1ebf
·
1 Parent(s): 1de17f8

fix: patch _install_signal_handlers on RQ worker to run inside background thread

Browse files
Files changed (1) hide show
  1. app/main.py +3 -1
app/main.py CHANGED
@@ -72,8 +72,10 @@ async def startup_event():
72
  try:
73
  conn = redis.Redis.from_url(settings.REDIS_URL)
74
  worker = Worker([Queue("default", connection=conn)], connection=conn)
 
 
75
  logger.info("Starting RQ background worker...")
76
- worker.work(with_scheduler=True, handle_signals=False)
77
  except Exception as e:
78
  logger.error(f"Failed to start RQ background worker: {e}")
79
 
 
72
  try:
73
  conn = redis.Redis.from_url(settings.REDIS_URL)
74
  worker = Worker([Queue("default", connection=conn)], connection=conn)
75
+ # Patch signal handler installation to prevent thread errors
76
+ worker._install_signal_handlers = lambda *args, **kwargs: None
77
  logger.info("Starting RQ background worker...")
78
+ worker.work(with_scheduler=True)
79
  except Exception as e:
80
  logger.error(f"Failed to start RQ background worker: {e}")
81