Best practice for testing recursive, potentially costly mutation
I'm nervous as there seems to be no manual kill switch for a recursive mutation call in convex.
I've setup basic logic to exit out, however still, I'd appreciate a second look along with some ideas for best practices regarding these costly fns.
2 Replies
this code looks good to me. i like how the
depth
argument guards against infinite loops. if you do end up with an infinite loop, note you can always go to Convex dashboard -> Settings -> Pause Deployment, which will stop all scheduled jobs but still let you cancel them or update your code with npx convex dev
.oh so there is a kill switch, nice!
And thanks for reviewing the code, @lee .
I have a follow up question somewhat related to this but i'll create a separate ticket.