Skip to content

Commit

Permalink
csle-cyborg [WIP]
Browse files Browse the repository at this point in the history
  • Loading branch information
Limmen committed Jan 13, 2024
1 parent 87017fe commit 90942a4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1648,6 +1648,7 @@ class METADATA_STORE:
SESSION_TOKENS_TABLE = "session_tokens"
TRACES_DATASETS_TABLE = "traces_datasets"
STATISTICS_DATASETS_TABLE = "statistics_datasets"
NUM_RETRIES_UPDATE_TRAINING_JOB = 5


class CONTAINER_POOLS:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1449,7 +1449,7 @@ def update_training_job(training_job: TrainingJobConfig, id: int) -> None:
:return: id of the created record
"""
Logger.__call__().get_logger().debug(f"Updating training job with id: {id} in the metastore")
for i in range(5):
for i in range(constants.METADATA_STORE.NUM_RETRIES_UPDATE_TRAINING_JOB):
try:
with psycopg.connect(
f"{constants.METADATA_STORE.DB_NAME_PROPERTY}={constants.METADATA_STORE.DBNAME} "
Expand All @@ -1465,6 +1465,7 @@ def update_training_job(training_job: TrainingJobConfig, id: int) -> None:
(config_json_str, id))
conn.commit()
Logger.__call__().get_logger().debug(f"Training job with id: {id} updated successfully")
break
except Exception:
pass

Expand Down

0 comments on commit 90942a4

Please sign in to comment.