Skip to content

Commit 5cde972

Browse files
authored
Ensure Hygraph sync background task uses fresh session (#89)
1 parent 5b86527 commit 5cde972

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

backend/api/routes_sync.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
from sqlalchemy.orm import Session
2121

2222
from api.config import get_settings
23-
from api.db import get_db
23+
from api.db import SessionLocal, get_db
2424
from api.models import SyncEvent
2525
from api.security import require_write_token, validate_hygraph_request
2626
from api.metrics import (

backend/tests/test_sync_routes_metrics.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
from __future__ import annotations
2+
23
import hashlib
34
import hmac
45
import json
56
import re
67

78
import pytest
89
from fastapi.testclient import TestClient
10+
from sqlalchemy import text
911

12+
from api.config import get_settings
1013
from api.main import app
1114

1215

0 commit comments

Comments
 (0)