Calling delay.Func uses the name of the file from whom this function was called to generate the func key that used in the task invocation. It means that deploying new version of service can break execution of tasks that were scheduled before, if the call of delay.Func moved to the another file in code.
This behaviour is not documented and can cause a confusion.
Related lines of code:
|
// Derive unique, somewhat stable key for this func. |
|
_, file, _, _ := runtime.Caller(1) |
|
f.key = file + ":" + key |