Open g-graziano opened 4 years ago
Hey @g-graziano, This project is now being maintained in this repo. You might want to check that out and see if this issue is still occurring. If it is, we can track this issue there.
This problem does exist, and the result of lock acquisition is not judged in the implementation.
func (j *Job) run() ([]reflect.Value, error) {
if j.lock {
if locker == nil {
return nil, fmt.Errorf("trying to lock %s with nil locker", j.jobFunc)
}
key := getFunctionKey(j.jobFunc)
**// This result is not judged`**
locker.Lock(key)
**// This result is not judged`**
defer locker.Unlock(key)
}
result, err := callJobFuncWithParams(j.funcs[j.jobFunc], j.fparams[j.jobFunc])
if err != nil {
return nil, err
}
return result, nil
}
hi @rtywei as @arjunmahishi mentioned - this repo is no longer maintained. We are maintaining it over at https://github.com/go-co-op/gocron but we have since removed the locker mechanism as it was not working and we have yet to come up with a good implementation.
i used lock implementation on redis, but it still run cron multiple times on multiple instances, i have 4 instances and it still run 4 times