ajvb / kala

Modern Job Scheduler
MIT License
2.13k stars 187 forks source link

NextRunAt - reports latest time not earliest #146

Closed shunte88 closed 6 years ago

shunte88 commented 7 years ago

the logic for determining next run time for a set of jobs is reversed and thus reports the latest run at time for the set

    if nextRun.IsZero() {
        nextRun = jobs.NextRunAt
    //} else if (nextRun.UnixNano() - jobs.NextRunAt.UnixNano()) < 0 {
    } else if (nextRun.UnixNano() - jobs.NextRunAt.UnixNano()) > 0 {
        nextRun = jobs.NextRunAt // we want earliest not latest
    }

simple fix to reverse the test ( > 0)

sblcook commented 6 years ago

Is it just the one line that needs to be changed?

shunte88 commented 6 years ago

yep just that one line

sblcook commented 6 years ago

Sweet. I will trying forking it and fixing it