ajvb / kala

Modern Job Scheduler

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NextRunAt - reports latest time not earliest

shunte88 opened this issue · comments

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)

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

yep just that one line

Sweet. I will trying forking it and fixing it