QuivrHQ / quivr

Open-source RAG Framework for building GenAI Second Brains 🧠 Build productivity assistant (RAG) ⚡️🤖 Chat with your docs (PDF, CSV, ...) & apps using Langchain, GPT 3.5 / 4 turbo, Private, Anthropic, VertexAI, Ollama, LLMs, Groq that you can share with users ! Efficient retrieval augmented generation framework
https://quivr.com
Other
35.91k stars 3.48k forks source link

Async in Notifications #2979

Closed linear[bot] closed 2 weeks ago

linear[bot] commented 1 month ago

In backend/worker/quivr_worker/celery_monitor.py

 # TODO(@aminediro): implement retry  if failure
                    if knowledge_id:
                        await knowledge_service.update_status_knowledge(
                            knowledge_id, KnowledgeStatus.UPLOADED
                        )
                    logger.info(
                        f"task {task.id} process_file_task {task_kwargs} failed. Updating knowledge {knowledge_id} to UPLOADED"
                    )
        except Exception as e:
            logger.exception(f"handling event {event} raised exception: {e}")

    with app.connection() as connection:
        recv = app.events.Receiver(
            connection,
            handlers={
                "task-failed": handle_task_event,  # FIXME: @aminediro check how to handle this
                "task-succeeded": handle_task_event,
            },
        )
        recv.capture(limit=None, timeout=None, wakeup=True)

Unable to call knowledge service in sync notifier;

linear[bot] commented 1 month ago

CORE-142 Async in Notifications