dify/api/events/event_handlers/clean_when_document_deleted.py

10 lines
297 B
Python
Raw Normal View History

2023-05-15 08:51:32 +08:00
from events.document_event import document_was_deleted
from tasks.clean_document_task import clean_document_task
@document_was_deleted.connect
def handle(sender, **kwargs):
document_id = sender
dataset_id = kwargs.get('dataset_id')
clean_document_task.delay(document_id, dataset_id)