]> git.0d.be Git - django-panik-nonstop.git/commitdiff
stamina: add debug print for overflows
authorFrédéric Péters <fpeters@0d.be>
Tue, 14 Jul 2020 04:12:54 +0000 (06:12 +0200)
committerFrédéric Péters <fpeters@0d.be>
Tue, 14 Jul 2020 04:12:54 +0000 (06:12 +0200)
nonstop/management/commands/stamina.py

index d64b1231defbe21a2a61121ed409209209fcbaa6..10d1dcc04e618801ca87f6756c0e3db71a3bb9d3 100644 (file)
@@ -77,6 +77,7 @@ class Command(BaseCommand):
                 # last track overshot
                 # 1st strategy: remove last track and try to get a track with
                 # exact remaining time
+                print('overshoot', current_datetime, file=sys.stderr)
                 playlist = playlist[:-1]
                 track = Track.objects.filter(
                         nonstop_zones=zone,
@@ -98,6 +99,7 @@ class Command(BaseCommand):
                         # or too many failures to get an appropriate file,
                         # allow whatever comes.
                         allow_overflow = True
+                        print('allow overflow', file=sys.stderr)
 
                 current_datetime = start_datetime + sum(
                         [x.duration for x in playlist], datetime.timedelta(seconds=0))