Refactoring finished :-)

eveai_workers now working (with errors ;-) )
Remote debugging now available
This commit is contained in:
Josako
2024-05-07 22:51:48 +02:00
parent 494d5508ae
commit cd5afa0408
14 changed files with 147 additions and 31 deletions

View File

@@ -10,6 +10,7 @@ from common.models.document import Document, DocumentLanguage, DocumentVersion
from common.extensions import db
from .document_forms import AddDocumentForm
from common.utils.middleware import mw_before_request
from common.utils.celery_utils import current_celery
document_bp = Blueprint('document_bp', __name__, url_prefix='/document')
@@ -68,8 +69,10 @@ def add_document():
# Save the file and process the document
if error is None:
flash('Document added successfully.', 'success')
current_app.logger.info(f'Document added successfully for tenant {session["tenant"]["id"]}, '
f'Document Version {new_doc.id}')
upload_file_for_version(new_doc_vers, file, extension)
task = current_app.celery.send_task('tasks.create_embeddings', args=[
task = current_celery.send_task('create_embeddings', queue='embeddings', args=[
session['tenant']['id'],
new_doc_vers.id,
session['default_embedding_model'],