Skip to content

Commit

Permalink
close_old_connections in process_rag_task
Browse files Browse the repository at this point in the history
  • Loading branch information
hummerichsander authored Jul 9, 2024
1 parent 722b3c0 commit 1fbcc8f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions radis/rag/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
from itertools import batched
from typing import Iterator, override

from channels.db import database_sync_to_async
from django import db
from django.conf import settings
from openai import OpenAI

Expand Down Expand Up @@ -44,6 +46,7 @@ async def process_rag_task(self, task: RagTask) -> None:
)
]
)
await database_sync_to_async(db.close_old_connections)()

async def process_report_instance(
self, report_instance: RagReportInstance, client: AsyncChatClient, sem: Semaphore
Expand Down

0 comments on commit 1fbcc8f

Please sign in to comment.