Approach to managing background actions

So I'm setting up a fairly extensive report schedule for my app. Essentially in the create or update actions of this schedule model, I will schedule a background action for the appropriate time/day. Then at the end of that background action I'll schedule the next one, and so on. But I'm going to need to introduce some logic here incase the user changes the schedule at all. Obviously we can't currently cancel background actions via the API so I'm thinking I'd need to a way to check if when the next scheduled action runs, matches the time the the schedule record is currently set to. Which means if it matches I can send the report and schedule the next background action. Where I'm stuck is how I can handle checking if the background action matches what the current record schedule is set to, does anybody have any suggestions at the best way to approach this? (attached a couple screenshots just to show how sophisticated the schedule UI is)
No description
No description
3 Replies
ljspoor94
ljspoor94OP•9mo ago
An additional thought: I suppose in the update action as well, I'll need to do a check somehow to ensure it doesn't keep scheduling another background action to send the report. I'm not sure if this will even be possible? 🤔
Unknown User
Unknown User•9mo ago
Message Not Public
Sign In & Join Server To View
ljspoor94
ljspoor94OP•9mo ago
Yep that went right over my head 😂

Did you find this page helpful?