@@ -408,21 +408,6 @@ func (cacheRepository *CacheRepository) SetJobAction(location string, jobid stri
408408 }
409409}
410410
411- //SetJobNextAt is exported
412- func (cacheRepository * CacheRepository ) SetJobNextAt (jobid string , nextat time.Time ) {
413-
414- logger .INFO ("[#cache#] set job nextat, %s %s" , jobid , nextat )
415- job := cacheRepository .GetJob (jobid )
416- if job != nil {
417- if len (job .Schedule ) > 0 {
418- job .Stat = models .STATE_STOPED
419- job .NextAt = nextat
420- logger .INFO ("[#cache#] set job %s nextat to %s, execat %s, state %d" , jobid , job .NextAt , job .ExecAt , job .Stat )
421- cacheRepository .storageDriver .SetJob (job )
422- }
423- }
424- }
425-
426411//SetJobState is exported
427412func (cacheRepository * CacheRepository ) SetJobState (jobid string , state int ) {
428413
@@ -438,11 +423,19 @@ func (cacheRepository *CacheRepository) SetJobState(jobid string, state int) {
438423 }
439424}
440425
441- //SetJobLog is exported
442- func (cacheRepository * CacheRepository ) SetJobLog ( joblog * models. JobLog ) {
426+ //SetJobNextAt is exported
427+ func (cacheRepository * CacheRepository ) SetJobNextAt ( jobid string , nextat time. Time ) {
443428
444- logger .INFO ("[#cache#] set job log, %s %d" , joblog .JobId , joblog .Stat )
445- cacheRepository .storageDriver .SetJobLog (joblog )
429+ logger .INFO ("[#cache#] set job nextat, %s %s" , jobid , nextat )
430+ job := cacheRepository .GetJob (jobid )
431+ if job != nil {
432+ if len (job .Schedule ) > 0 {
433+ job .Stat = models .STATE_STOPED
434+ job .NextAt = nextat
435+ logger .INFO ("[#cache#] set job %s nextat to %s, execat %s, state %d" , jobid , job .NextAt , job .ExecAt , job .Stat )
436+ cacheRepository .storageDriver .SetJob (job )
437+ }
438+ }
446439}
447440
448441//SetJobExecute is exported
@@ -467,6 +460,13 @@ func (cacheRepository *CacheRepository) SetJobExecute(jobid string, state int, e
467460 }
468461}
469462
463+ //SetJobLog is exported
464+ func (cacheRepository * CacheRepository ) SetJobLog (joblog * models.JobLog ) {
465+
466+ logger .INFO ("[#cache#] set job log, %s %d" , joblog .JobId , joblog .Stat )
467+ cacheRepository .storageDriver .SetJobLog (joblog )
468+ }
469+
470470//GetWorker is exported
471471func (cacheRepository * CacheRepository ) GetWorker (key string ) * Worker {
472472
0 commit comments