Add PEP-484 type annotations to zerver/worker/.

This commit is contained in:
Tim Abbott 2016-01-25 17:12:59 -08:00
parent ec7bb0b011
commit ee8be22160
1 changed files with 3 additions and 2 deletions

View File

@ -1,4 +1,5 @@
from __future__ import absolute_import from __future__ import absolute_import
from typing import *
from django.conf import settings from django.conf import settings
from django.core.handlers.wsgi import WSGIRequest from django.core.handlers.wsgi import WSGIRequest
@ -56,7 +57,7 @@ def get_active_worker_queues():
return list(worker_classes.keys()) return list(worker_classes.keys())
class QueueProcessingWorker(object): class QueueProcessingWorker(object):
queue_name = None queue_name = None # type: str
def __init__(self): def __init__(self):
self.q = None # type: SimpleQueueClient self.q = None # type: SimpleQueueClient
@ -178,7 +179,7 @@ class MissedMessageWorker(QueueProcessingWorker):
def start(self): def start(self):
while True: while True:
missed_events = self.q.drain_queue("missedmessage_emails", json=True) missed_events = self.q.drain_queue("missedmessage_emails", json=True)
by_recipient = defaultdict(list) by_recipient = defaultdict(list) # type: Dict[int, List[Dict[str, Any]]]
for event in missed_events: for event in missed_events:
logging.info("Received event: %s" % (event,)) logging.info("Received event: %s" % (event,))