framework
framework copied to clipboard
Ensure single decorator should raise when discarding tasks
The ensure single decorator currently returns None if a task is being discarded because of other similar tasks already being executed. The user could be mislead in 2 ways:
- When he gets a return value of None, he could assume the job was successful, while it actually did not start/execute at all.
- When he gets a return value of None, while he expected some specific value, the code could raise or act differently
Instead we should raise our own custom DiscardException or something similar, so the user always knows what happened and could potentially try again