From bec2e77e0bdc6d5e9ac5384de6bf6d69d9cb629b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Wed, 19 Aug 2020 14:13:38 +0200 Subject: [PATCH] stamina: remove sleep debugging --- nonstop/app_settings.py | 4 ---- nonstop/management/commands/stamina.py | 8 -------- 2 files changed, 12 deletions(-) diff --git a/nonstop/app_settings.py b/nonstop/app_settings.py index 5e376d5..51316ad 100644 --- a/nonstop/app_settings.py +++ b/nonstop/app_settings.py @@ -18,10 +18,6 @@ class AppSettings: # relative to ..._BASE_PATH return self.get_setting('JINGLES_PREFIX', 'SPOTS') - @property - def DEBUG_WITH_SLEEPS(self): - return self.get_setting('DEBUG_WITH_SLEEPS', False) - @property def PLAYER_COMMAND(self): return self.get_setting('PLAYER_COMMAND', 'mpv') diff --git a/nonstop/management/commands/stamina.py b/nonstop/management/commands/stamina.py index e9eeb85..e668445 100644 --- a/nonstop/management/commands/stamina.py +++ b/nonstop/management/commands/stamina.py @@ -194,14 +194,6 @@ class Command(BaseCommand): else: cmd.append(item.file_path()) logger.info('Play file: %s', item.file_path()) - if app_settings.DEBUG_WITH_SLEEPS: - # replace command by a sleep call, for silent debugging - if hasattr(item, 'is_stream') and item.is_stream(): - cmd = 'sleep 86400 # %s' % item.stream.url - elif isinstance(item.duration, datetime.timedelta): - cmd = 'sleep %s # %s' % (item.duration.total_seconds(), item.file_path()) - elif isinstance(item.duration, int): - cmd = 'sleep %s # %s' % (item.duration, item.file_path()) logger.debug('cmd %r', cmd) if isinstance(cmd, str): self.player = await asyncio.create_subprocess_shell( -- 2.39.2