Skip to content

Commit

Permalink
Merge pull request #907 from aybruhm/gh/resolve-race-condition-dbmanager
Browse files Browse the repository at this point in the history
[Bug Fix]: Resolve race condition => Base deployment issue
  • Loading branch information
aybruhm authored Nov 17, 2023
2 parents edfefcd + 21db804 commit 6304f4b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion agenta-backend/agenta_backend/routers/app_router.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ async def add_variant_from_image(
status_code=500,
detail="Image should have a tag starting with the registry name (agenta-server)",
)
elif deployment_manager.validate_image(image) is False:
elif await deployment_manager.validate_image(image) is False:
raise HTTPException(status_code=404, detail="Image not found")

try:
Expand Down
7 changes: 2 additions & 5 deletions agenta-backend/agenta_backend/services/db_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -1153,9 +1153,6 @@ async def update_variant_parameters(
try:
logging.debug("Updating variant parameters")

# Update AppVariantDB parameters
app_variant_db.parameters = parameters

# Update associated ConfigDB parameters and versioning
config_db = app_variant_db.config
new_version = config_db.current_version + 1
Expand All @@ -1168,9 +1165,9 @@ async def update_variant_parameters(
)
config_db.current_version = new_version
config_db.parameters = parameters
# Save updated ConfigDB and AppVariantDB

# Save updated ConfigDB
await engine.save(config_db)
await engine.save(app_variant_db)

except Exception as e:
logging.error(f"Issue updating variant parameters: {e}")
Expand Down

0 comments on commit 6304f4b

Please sign in to comment.