Re-work :skip_first_run and :at interaction #22
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As @MarcLapierre pointed out here the skip first run option broke cases where multiple
:at
were used. This was due to myself not truly understanding how:at
worked. It will actually schedule an event for each:at
argument, and each of those events would then have:skip_first_run
causing it to skip a single first run. W/ a long enough period and short enough restart interval it would cause these events to never run.The change to make this work properly is to move the
:skip_first_run
checks from out of theevent
and into themanager
. When the first event is run, it will skip, and then look for any identical events and clear theskip_first_run
flag on all of those. So the first event will be skipped, but subsequent events should run perfectly fine.My apologies for missing the concern, saw the first comment about it breaking the test gem, but then didn't read about the failure of the interaction.
One thought about this, it might be worthwhile to be able to gather these events via some unique ID, instead of relying on users naming their events uniquely.