-
-
Notifications
You must be signed in to change notification settings - Fork 80
Description
I'm working on a use-case that is somewhat atypical, at least when compared to the examples within the project.
The application itself uses Actix Web to expose admin endpoints to manage a list of devices, and Apallis automatically spins up workers that continously monitor them. (1-1 mapping, each device has a worker on an infinite loop)
While prototyping, I noticed duplicate jobs were launched after a certain amount of time, leading to conflicts in operations. This was caused by the reenqueue_orphaned_after value since long running operations are considered orphaned. The default value is 5 minutes, which made it very difficult to identity :)
I settled on simply providing a very large duration (>100 years) to avoid having duplicate tasks, but I'm wondering if there's apetite to officially support this type of workflow?
let postgres_config = Config::new("apalis::devices")
.set_reenqueue_orphaned_after(Duration::from_secs(u32::MAX as u64));We could set an Option<Duration> value instead, which would skip the check entirely.