I’m scheduling a task that needs to run once and then be deleted. There may be multiple tasks set by the module, all needing to operate with different parameters. I’m wondering if I’m missing some functionality of this new feature. Is there any way for a job to be self-aware? That is, be aware of its info (name, schedule, etc)?
At the moment, my thought is to name the job, e.g.
myjob_2317 and store parameters in a KV store key
2317 (for a job scheduled to run at 11:17pm.) When the job is run, it can get the current time, and use that to find the KV store values and also delete itself.
There are a number of obvious problems with this approach, such as not being able to run the job early, and the possibility that prior jobs might run long enough to push into the next minute.
Any thoughts or workarounds?