How to retry all jobs from a Bull Queue that shares google docs

33 Views Asked by At

I’m not entirely certain about the root cause of this problem, as it could be attributed to either the Bull Queue or Google not functioning correctly. I have an application where documents are either uploaded or generated, and upon addition or generation, they become owned by a Google service account. To facilitate sharing these files with the team, a job is added to the queue, which then shares the files using the Google service account.

I am currently experiencing an issue with a Bull Queue that I am using. When files are meant to be shared in my application, they are placed into a queue and scheduled to be shared every 15 seconds to prevent an excessive number of requests to the Google API. However, recently, it seems that the sharing job enters the queue but never exits it, resulting in no files being shared. Initially, this issue affected some users and certain files, with some files experiencing delays of up to 12 hours before being shared. Currently, no files are being shared at all.

This is not new code added, this worked fine for years until it recently stopped working. I've made no updates recently that could cause any issues with it. There's also no errors logged that would show the jobs are failed.

I am uncertain whether this issue is related to the queue being overloaded, although at one point, it did contain more than 6000 files waiting to be shared. The same queue works without issues in other environments. I’m not entirely sure if this problem is associated with the queue or a Google-related error. My initial assumption was that I might be triggering the rate limit for file sharing. Do you have any insights into what might be causing this issue?

This is the configuration for the Redis job:

{
   "name": "shareGoogleDoc",
        "attempts": 2,
        "limiter": {
          "max": 1,
          "duration": 15000
        }
}

Please let me know if you need more information.

I have tried emptying the queue to restart from scratch in case it was being overloaded. Also tried changing the google service account to a new one to see if it would start sharing the files. Both of these didn't work.

0

There are 0 best solutions below