fix(cron): update file permission mode to use octal notation in test and fix some lint errors
This commit is contained in:
parent
51cb387219
commit
991c7845d5
2 changed files with 1 additions and 3 deletions
|
|
@ -300,7 +300,6 @@ func (cs *CronService) executeJobByID(jobID string) {
|
||||||
|
|
||||||
func (cs *CronService) computeNextRun(schedule *CronSchedule, nowMS int64) *int64 {
|
func (cs *CronService) computeNextRun(schedule *CronSchedule, nowMS int64) *int64 {
|
||||||
switch schedule.Kind {
|
switch schedule.Kind {
|
||||||
|
|
||||||
case "at":
|
case "at":
|
||||||
if schedule.AtMS != nil && *schedule.AtMS > nowMS {
|
if schedule.AtMS != nil && *schedule.AtMS > nowMS {
|
||||||
return schedule.AtMS
|
return schedule.AtMS
|
||||||
|
|
@ -331,7 +330,6 @@ func (cs *CronService) computeNextRun(schedule *CronSchedule, nowMS int64) *int6
|
||||||
log.Printf("[cron] unknown schedule kind '%s'", schedule.Kind)
|
log.Printf("[cron] unknown schedule kind '%s'", schedule.Kind)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (cs *CronService) recomputeNextRuns() {
|
func (cs *CronService) recomputeNextRuns() {
|
||||||
|
|
|
||||||
|
|
@ -186,7 +186,7 @@ func TestCronService_PersistenceIntegrity(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// test loading invalid JSON
|
// test loading invalid JSON
|
||||||
os.WriteFile(tmpFile, []byte("{invalid json}"), 0644)
|
os.WriteFile(tmpFile, []byte("{invalid json}"), 0o644)
|
||||||
cs3 := NewCronService(tmpFile, nil)
|
cs3 := NewCronService(tmpFile, nil)
|
||||||
err := cs3.loadStore()
|
err := cs3.loadStore()
|
||||||
if err == nil {
|
if err == nil {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue