You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
2021/11/29 13:34:10 normal cron at: 2021-11-29 13:34:10.541174 +0100 CET m=+0.001237376
2021/11/29 13:34:25 Something completely different
2021/11/29 13:34:30 Something completely different
So until the subsequent/unqualified .Do() call the scheduler will run the "normal" 15 second func, but once a .Do is set it replaces the existing one with the newly passed func.
The (for me) expected output should have been:
2021/11/29 13:35:10 normal cron at: 2021-11-29 13:35:10.215062 +0100 CET m=+0.000477251
2021/11/29 13:35:15 Something completely different
2021/11/29 13:35:25 normal cron at: 2021-11-29 13:35:25.220175 +0100 CET m=+15.005519585
I can understand that this is probably a mistake on my part or that I am mis-using the libs fluent interface - but then again this code looks totally normal and when reading this I'd expect to be scheduling 2 separate jobs - not to replace the existing payload :/
Maybe some safeguards can be inserted into Do to prevent it from overriding the previous already submitted func?
The text was updated successfully, but these errors were encountered:
I'll post something here quickly: what I am seeing is that we aren't handling this properly, but the first method that needs to be called is Every() or Cron() which instantiates the job. So in this case, StartImmediately() is being called it's grabbing the current job which is your "normal cron" job and then changing the frequency at which it runs.
I ran into a really nasty issue with
StartImmediately
and.Do()
.Basically the following code will behave completely un-expected:
The output is:
So until the subsequent/unqualified
.Do()
call the scheduler will run the "normal" 15 second func, but once a.Do
is set it replaces the existing one with the newly passed func.The (for me) expected output should have been:
To get to this I had to change the code to:
I can understand that this is probably a mistake on my part or that I am mis-using the libs fluent interface - but then again this code looks totally normal and when reading this I'd expect to be scheduling 2 separate jobs - not to replace the existing payload :/
Maybe some safeguards can be inserted into
Do
to prevent it from overriding the previous already submitted func?The text was updated successfully, but these errors were encountered: