add aircox.test utilities
This commit is contained in:
@ -17,6 +17,7 @@ from django.utils import timezone as tz
|
||||
from aircox.models import Station
|
||||
from aircox_streamer.controllers import Monitor, Streamer
|
||||
|
||||
|
||||
# force using UTC
|
||||
tz.activate(pytz.UTC)
|
||||
|
||||
@ -68,7 +69,7 @@ class Command(BaseCommand):
|
||||
"-t",
|
||||
"--timeout",
|
||||
type=float,
|
||||
default=Monitor.cancel_timeout,
|
||||
default=Monitor.cancel_timeout.total_seconds() / 60,
|
||||
help="time to wait in MINUTES before canceling a diffusion that "
|
||||
"should have ran but did not. ",
|
||||
)
|
||||
@ -106,7 +107,8 @@ class Command(BaseCommand):
|
||||
delay = tz.timedelta(milliseconds=delay)
|
||||
timeout = tz.timedelta(minutes=timeout)
|
||||
monitors = [
|
||||
Monitor(streamer, delay, timeout) for streamer in streamers
|
||||
Monitor(streamer, delay, cancel_timeout=timeout)
|
||||
for streamer in streamers
|
||||
]
|
||||
|
||||
while not run or streamer.is_running:
|
||||
|
Reference in New Issue
Block a user