Has anybody solved implementing a trigger for _scheduled_functions changes?
I'm creating a job queue, in which I ctx.schedule jobs, and I'd like to update the resulting jobQueue record when it's complete (my jobQueue objects are different and used differently from the primitive _scheduled_functions).
I've tried the convex-helpers/trigger, but it doesn't seem to fire on the _scheduled_functions tables, as I don't update it directly.
Here's how I'm using the queue:
3 Replies
Thanks for posting in <#1088161997662724167>.
Reminder: If you have a Convex Pro account, use the Convex Dashboard to file support tickets.
- Provide context: What are you trying to achieve, what is the end-user interaction, what are you seeing? (full error message, command output, etc.)
- Use search.convex.dev to search Docs, Stack, and Discord all at once.
- Additionally, you can post your questions in the Convex Community's <#1228095053885476985> channel to receive a response from AI.
- Avoid tagging staff unless specifically instructed.
Thank you!
Yeah triggers on scheduled jobs aren't implemented. Triggers as currently implemented only run when your code modifies a table, so even if we did run triggers on ctx.scheduler methods, they wouldn't get run when the job completes, because that's not done by your code.
Instead, you could make the scheduled functions themselves have wrappers, like
runMutationWrapper
from https://github.com/get-convex/workpool/blob/main/src/component/lib.tsGitHub
workpool/src/component/lib.ts at main · get-convex/workpool
Contribute to get-convex/workpool development by creating an account on GitHub.
Excellent! Thanks @lee 🤗