cake
cake2mo ago

Is there a better way to run action from mutations / queries than `ctx.scheduler.runAfter(0,`

This seems like an odd way of running actions from mutations / queries, specifying a delay of 0. Is there a better way to do this?
2 Replies
Convex Bot
Convex Bot2mo ago
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!
ian
ian2mo ago
no that's standard - essentially you can't wait for an action to run from a mutation, since mutations can't have side effects. You could use the Workpool to enqueue it, if you have a bunch to do.

Did you find this page helpful?