소스 검색

Fix timedelta check in cron module

Daniel Vincze 5 년 전
부모
커밋
6348218d54
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      coriolis/cron/cron.py

+ 1 - 1
coriolis/cron/cron.py

@@ -105,7 +105,7 @@ class CronJob(object):
             LOG.debug('Job %s is not enabled', self.name)
             LOG.debug('Job %s is not enabled', self.name)
             return False
             return False
         if self._last_run:
         if self._last_run:
-            if (dt - self._last_run).seconds < 60:
+            if (dt - self._last_run).total_seconds() < 60:
                 LOG.debug('Job %s has last run in less than a minute ago. '
                 LOG.debug('Job %s has last run in less than a minute ago. '
                           'Skipping.', self.name)
                           'Skipping.', self.name)
                 return False
                 return False