scheduled jobs randomly stop working

Kkantorcodes2/13/2023
Hello! I have three different scheduled jobs at different intervals.

1 minute
10 minutes
2 minutes

They will run the first few times just fine. However, afterwards they just stop running entirely. I have to reboot sapphire completely for them to restart.

For context, this is using the latest none-alpha versions for scheduled tasks and the sapphire framework + it's dependencies
FFavna2/13/2023
Depending on whether you use the bullmq or Amazon sqs method you're best off asking them because the sapphire plugin is only a very tiny wrapper around either services. The sapphire plugin does basically nothing but call those services.
Kkantorcodes2/13/2023
Gotcha, thank you. Yes, it's bullmq
Kkantorcodes2/13/2023
Could you tell me what methods we are calling in that library @Favna
Kkantorcodes2/14/2023
Thank you. Looking at the bullmq issues it appears this is common
FFavna2/14/2023
oh :\
FFavna2/14/2023
sorry to hear that
FFavna2/14/2023
we also tried different libs but we cant find anything that can be a good replacement
FFavna2/14/2023
interesting last message there
FFavna2/14/2023
suppose you can try that
Kkantorcodes2/14/2023
I am giving it a whirl now 🤞
Kkantorcodes2/14/2023
The weird thing is that the jobs don't get stuck immediately
Kkantorcodes2/14/2023
it is after a random period of time
Kkantorcodes2/14/2023
No dice.
FFC2/15/2023
Im facing this issue aswell. deleting all tasks and registering them again works fine for me usually
Kkantorcodes2/15/2023
Could you clarify what you did?
Kkantorcodes2/15/2023
I had to resort to using pm2 with a cron restart pattern for the moment
FFC2/15/2023
Get all the tasks using container.client.tasks.list then loop through them and call tasks.delete on each task. Then just restart your bot and sapphire should register your tasks again
FFavna2/15/2023
We could expedite this process by making container.tasks.reregister and container.tasks.reregisterAll I suppose
FFavna2/15/2023
Err the first one would be on a specific task I think. I don't remember how the structure is from the top of my head
Kkantorcodes2/15/2023
sorry to bug you, but do you have example code?
Kkantorcodes2/15/2023
it does seem this came up after the upgrade to bullmq v3
FFC2/16/2023
Something like this should hopefully work:
const jobs = await this.container.tasks.list({ types: ['delayed'] });
for (const a of job) a.delete()
FFC2/16/2023
You can probably just eval that code and restart your bot it will register the tasks again
Kkantorcodes2/17/2023
Hmm, what runs this code?
Kkantorcodes2/17/2023
Just any other command that gets called?
FFC2/18/2023
You can just create a temp command to run it or just eval it if you have an eval command
Kkantorcodes2/18/2023
Ah okay I see. The pm2 solution automates this problem so I'll probably keep using that until there's something better
PPhoton2/19/2023
It happens when you change the JobName
PPhoton2/19/2023
I have faced this issue before, posted in #old-sapphire-support but can't find at the moment hah, but that's the reason I think that it happened
Kkantorcodes2/21/2023
Hmm what do you mean by that specifically?