This commit is contained in:
bakatrouble 2019-01-31 00:14:12 +03:00
parent fbfe97fe5b
commit 0334a04260

View File

@ -1,4 +1,3 @@
from django.db import transaction
from pyrogram import Error from pyrogram import Error
from .client import get_client from .client import get_client
@ -13,7 +12,7 @@ def aggregation_source_deleted(sender, instance: AggregationSource, **kwargs):
def chat_created(sender, instance: Chat, created, **kwargs): def chat_created(sender, instance: Chat, created, **kwargs):
if created: if created:
transaction.on_commit(lambda: collect_new_messages.delay(instance.pk)) collect_new_messages.delay(instance.pk)
def chat_deleted(sender, instance: Chat, **kwargs): def chat_deleted(sender, instance: Chat, **kwargs):