Skip to content

Commit

Permalink
Only check if returned object ID is different from existing_object_id…
Browse files Browse the repository at this point in the history
… for functions (#2580)
  • Loading branch information
devennavani authored Nov 27, 2024
1 parent e44d854 commit 2903bbe
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions modal/_resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,14 @@ async def loader():
raise NotFoundError(exc.message)
raise

# Check that the id of functions and classes didn't change
# Check that the id of functions didn't change
# Persisted refs are ignored because their life cycle is managed independently.
if not obj._is_another_app and existing_object_id is not None and obj.object_id != existing_object_id:
if (
not obj._is_another_app
and existing_object_id is not None
and existing_object_id.startswith("fu-")
and obj.object_id != existing_object_id
):
raise Exception(
f"Tried creating an object using existing id {existing_object_id}"
f" but it has id {obj.object_id}"
Expand Down

0 comments on commit 2903bbe

Please sign in to comment.