diff --git a/channels/management/commands/runserver.py b/channels/management/commands/runserver.py index e52b018..e2c0814 100644 --- a/channels/management/commands/runserver.py +++ b/channels/management/commands/runserver.py @@ -24,10 +24,13 @@ class Command(RunserverCommand): help='Tells Django not to run a worker thread; you\'ll need to run one separately.') parser.add_argument('--noasgi', action='store_false', dest='use_asgi', default=True, help='Run the old WSGI-based runserver rather than the ASGI-based one') + parser.add_argument('--http_timeout', action='store', dest='http_timeout', type=int, default=60, + help='Specify the daphane http_timeout interval in seconds (default: 60)') def handle(self, *args, **options): self.verbosity = options.get("verbosity", 1) self.logger = setup_logger('django.channels', self.verbosity) + self.http_timeout = options.get("http_timeout", 60) super(Command, self).handle(*args, **options) def inner_run(self, *args, **options): @@ -80,7 +83,7 @@ class Command(RunserverCommand): port=int(self.port), signal_handlers=not options['use_reloader'], action_logger=self.log_action, - http_timeout=60, # Shorter timeout than normal as it's dev + http_timeout=self.http_timeout, ws_protocols=getattr(settings, 'CHANNELS_WS_PROTOCOLS', None), ).run() self.logger.debug("Daphne exited")