How long does a background action live?
If I pass an id, and onDuplicate: ignore, how long after the first occurance of the action will it not skip again? Meaning if if I call the action again with the same id, how long after the first run will it now run again?
4 Replies
Hi Jay,
for the duplicate check it will re-occur once the action from the queue occurs, or fails permanently. It is not a time based system.
Failing permanently depends on how long it takes for your retries.
yeah, the no duplicate ids thing will be enforced until the original execution is fully deleted, which means actions sitting around in a succeeded state or a failed state will not allow new actions to be enqueued with the same id
but after the action is automatically cleaned up (1 day retention for completed actions, 7 day retention for failed or cancelled actions today), the id can be reused
those timings are subject to change though
Correct. If it is succeful, but needs to be re-run due to a new update, it will skip
generally, you need to pick an algorithm for generating the action id that means duplicates will be prevented but non-duplicates wont. it depends on the use case but you can do that by building string ids that include timestamps or a hash of a records values or something like that