Giveth / feathers-giveth

Featherjs server for caching giveth data.
MIT License
87 stars 99 forks source link

F 594 fix stuck event handler queue #598

Closed mohammadranjbarz closed 3 years ago

mohammadranjbarz commented 3 years ago

We have two main problems on #594

  1. Why queue stocks on a job? I think maybe because rinkbey network or infura, ..., so a job stocks and other jobs cant start, now I check if after two minutes the job process doesn't end, I call done() manually to not block next jobs

  2. Why after restarting the backend, do some jobs process multiple times? we have some checking, for example, every 15 minutes we check if there is a Pending campaign we add a job to process that event, so when the queue is blocked for 5 hours, in this time we add 20(5hours * 4 times in an hour) jobs to process same event, so when we restart the application and the queue is not blocked anymore, we start to process the same event 20 times, for preventing this before handling event I check the event status in DB to be sure it's not Processed