2 Answer(s)
-
0
Hi, thanks for sharing your background worker implementation and the issue you're encountering. It occurred to me the reason is: Quartz Scheduler Initialization Delay or Deadlock
When the application runs for the first time, the Quartz scheduler might not have fully initialized before
ScheduleJob
is executed. This can cause the worker to hang or time out.✅As a solution: Move the Quartz scheduling logic to the
Execute
method instead of the constructor. Avoid heavy logic in constructors — especially logic that includes async calls or service resolutions. -
0
Hi, thanks for sharing your background worker implementation and the issue you're encountering. It occurred to me the reason is: Quartz Scheduler Initialization Delay or Deadlock
When the application runs for the first time, the Quartz scheduler might not have fully initialized before
ScheduleJob
is executed. This can cause the worker to hang or time out.✅As a solution: Move the Quartz scheduling logic to the
Execute
method instead of the constructor. Avoid heavy logic in constructors — especially logic that includes async calls or service resolutions.Thank you for sharing. it work fine after i move Quartz scheduling logic to the Execute