Browse Source

Bugfix: cron_task fails when last_update_success is null in DB.

pitchum 6 years ago
parent
commit
0e4c233d10
1 changed files with 3 additions and 3 deletions
  1. 3 3
      ffdnispdb/cron_task.py

+ 3 - 3
ffdnispdb/cron_task.py

@@ -103,8 +103,8 @@ try:
             .order_by(ISP.last_update_success):
         try:
             print u'%s: Attempting to update %s' % (datetime.now(), isp)
-            print u'    last successful update=%s' % (utils.tosystemtz(isp.last_update_success))
-            print u'    last update attempt=%s' % (utils.tosystemtz(isp.last_update_attempt))
+            print u'    last successful update={:%Y-%m-%d %H:%M}'.format(isp.last_update_success)
+            print u'    last update attempt={:%Y-%m-%d %H:%M}'.format(isp.last_update_attempt)
             print u'    next update was scheduled %s ago' % (utils.utcnow() - isp.next_update)
             print u'    strike=%d' % (isp.update_error_strike)
 
@@ -151,7 +151,7 @@ try:
             db.session.commit()
 
             print u'%s: Update successful !' % (datetime.now())
-            print u'    next update is scheduled for %s\n' % (isp.next_update)
+            print u'    next update is scheduled for {:%Y-%m-%d %H:%M}\n'.format(isp.next_update)
         except Timeout:
             print u'%s: Timeout while updating:' % (datetime.now())
             isp = ISP.query.get(isp.id)