- Zapier Document Refresh action (create) added

This commit is contained in:
Josako
2024-12-17 16:40:21 +01:00
parent 53c625599a
commit f7cd58ed2a
9 changed files with 381 additions and 194 deletions

View File

@@ -35,6 +35,7 @@ def ping():
@current_celery.task(name='create_embeddings', queue='embeddings')
def create_embeddings(tenant_id, document_version_id):
document_version = None
try:
# Retrieve Tenant for which we are processing
tenant = Tenant.query.get(tenant_id)
@@ -66,6 +67,8 @@ def create_embeddings(tenant_id, document_version_id):
f'for badly configured document version {document_version_id} '
f'for tenant {tenant_id}, '
f'error: {e}')
if document_version:
document_version.processing_error = str(e)
raise
# BusinessEvent creates a context, which is why we need to use it with a with block