fix imports

This commit is contained in:
2019-01-28 00:32:34 +03:00
parent fbfe72c774
commit cba3643e02
2 changed files with 4 additions and 3 deletions
+2 -1
View File
@@ -3,12 +3,13 @@ from celery_once import QueueOnce
from aggregator.client import get_client
from config.celery import app
from .models import Chat
from .client import collect_new_messages as _collect_new_messages
@app.task(base=QueueOnce, once={'keys': ['chat_id'], 'graceful': True})
def collect_new_messages(chat_id):
from .models import Chat
chat = Chat.objects.get(pk=chat_id)
with get_client() as client:
_collect_new_messages(client, chat)