YorkshireDigital / YorkshireTec.com

YorkshireDigital Website
www.yorkshiredigital.com
0 stars 0 forks source link

Hangfire jobs keep stopping #51

Open MacsDickinson opened 9 years ago

MacsDickinson commented 9 years ago

There's been a few scenarios where hangfire is showing no active or recurring jobs. I think this is happening when the server or site is restarted.

This needs further investigation

MacsDickinson commented 9 years ago

Figured out what is causing the memory leak. When we get throttled by the meetup api an exception is thrown in the processing task. This causes the task to stop processing without disposing of the database session correctly.

The tasks need to be updated to handle errors gracefully but we will also part solve this by throttling our requests to the api when they start complaining.

Rather than having the hangfire tasks query the meetup api directly I'm going to make use of a message queue. Our group and event sync tasks will simply fire messages into the message queue, requesting for a group or event to be looked up on the meetup api. We will then have a separate task reading from the queue and checking against the meetup api. This task will recognise if the connection is being throttled and will slow the execution accordingly.