flightless/action-scheduler — pull request #19 by thenbrent (2014-04-24 01:44:56+00:00)
Title: Restrict batches, prevent duplicates & improve timeout handling

SHA: d2622784 restricts the scheduler to 5 concurrent batches (a solution to issues outlined in #17).

SHA: fcfd9c6 prevents an action from being processed more than once if it was reset because the batch it belonged too had taken more than 5 minutes to comlpete (but was still running).

SHA: 5e07516 sets the modified date to the date/time an action is triggered, to improve record keeping and so that `mark_failures()` correctly identifies actions that have been in progress for more than 30 minutes (rather than potentially just in the queue for 30 minutes but missed by `reset_timeouts()` because of a `'action_scheduler_cleanup_batch_size'` value too low).

SHA: 3140fc2 sets the cleanup batch size to same size as the runner batch size to capture all actions added to a queue when resetting timeouts. This is important to avoid having actions sit in the queue for significant amounts of time and also, before SHA: 5e07516972, be marked as timing out before even having a chance to start running (because they were added to the queue 30 minutes prior, not because they'd been running for 30 minutes).