]> git.0d.be Git - django-panik-nonstop.git/commitdiff
include timestamp in print()
authorFrédéric Péters <fpeters@0d.be>
Thu, 21 May 2020 10:15:58 +0000 (12:15 +0200)
committerFrédéric Péters <fpeters@0d.be>
Thu, 2 Jul 2020 08:01:29 +0000 (10:01 +0200)
nonstop/management/commands/stamina.py

index 46495542b469b3ba3da7eaca64a40289a029a2c3..e376b89ba0a42f88aa7c604c7a642d931c1e609b 100644 (file)
@@ -202,8 +202,8 @@ class Command(BaseCommand):
                 self.slot.end_datetime = diffusion.datetime
 
     async def recompute_slots_loop(self):
-        print('recompute_slots_loop')
         now = datetime.datetime.now()
+        print(now, 'recompute_slots_loop')
         sleep = (60 - now.second) % 10  # adjust to awake at :00
         while not self.quit:
             await asyncio.sleep(sleep)
@@ -212,7 +212,7 @@ class Command(BaseCommand):
             self.recompute_slots()
             expected_slot = self.slot
             if current_slot != expected_slot:
-                print('unexpected change', current_slot, 'vs', expected_slot)
+                print(now, 'unexpected change', current_slot, 'vs', expected_slot)
                 if isinstance(current_slot, Nonstop) and not isinstance(expected_slot, Nonstop):
                     # interrupt nonstop
                     print('interrupting nonstop')