Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
327 changes: 280 additions & 47 deletions backend/app/services/background_chat_executor.py

Large diffs are not rendered by default.

14 changes: 5 additions & 9 deletions backend/app/services/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from app.core.cache import cache_manager
from app.core.config import settings
from app.core.distributed_lock import distributed_lock
from app.db.session import AsyncSessionLocal, SessionLocal
from app.db.session import AsyncSessionLocal
from app.services.adapters.executor_job import job_service
from app.services.executor_cleanup_cursor_service import EXECUTOR_CLEANUP_CURSOR_KEY
from app.services.repository_job import repository_job_service
Expand Down Expand Up @@ -159,14 +159,10 @@ def repo_update_worker(stop_event: threading.Event):
try:
logger.info("[job] Starting repository cache update task")

db = SessionLocal()
try:
# Run the repository update job asynchronously
loop.run_until_complete(
repository_job_service.update_repositories_for_all_users(db)
)
finally:
db.close()
# Run the repository update job asynchronously
loop.run_until_complete(
repository_job_service.update_repositories_for_all_users()
)

logger.info(
"[job] Repository cache update task execution completed"
Expand Down
Loading
Loading