Skip to content

Commit

Permalink
remove execution_options when recording usages (#1523)
Browse files Browse the repository at this point in the history
  • Loading branch information
ImMohammad20000 authored Dec 16, 2024
1 parent 52f9502 commit 4bc248e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/jobs/record_usages.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from typing import Union

from pymysql.err import OperationalError
from sqlalchemy import and_, bindparam, insert, select, update
from sqlalchemy import and_, bindparam, insert, select, update
from sqlalchemy.orm import Session
from sqlalchemy.sql.dml import Insert

Expand All @@ -15,7 +15,7 @@
from config import (
DISABLE_RECORDING_NODE_USAGE,
JOB_RECORD_NODE_USAGES_INTERVAL,
JOB_RECORD_USER_USAGES_INTERVAL
JOB_RECORD_USER_USAGES_INTERVAL,
)
from xray_api import XRay as XRayAPI
from xray_api import exc as xray_exc
Expand All @@ -30,7 +30,7 @@ def safe_execute(db: Session, stmt, params=None):
done = False
while not done:
try:
db.connection().execute(stmt, params, execution_options={"synchronize_session": None})
db.connection().execute(stmt, params)
db.commit()
done = True
except OperationalError as err:
Expand All @@ -41,7 +41,7 @@ def safe_execute(db: Session, stmt, params=None):
raise err

else:
db.connection().execute(stmt, params, execution_options={"synchronize_session": None})
db.connection().execute(stmt, params)
db.commit()


Expand Down

0 comments on commit 4bc248e

Please sign in to comment.