Skip to content

Commit

Permalink
clean up assertion in resolver (#2057)
Browse files Browse the repository at this point in the history
  • Loading branch information
erikbern committed Jul 29, 2024
1 parent 721c9b8 commit d01ffa0
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions modal/_resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,15 +127,12 @@ async def loader():
raise

# Check that the id of functions and classes didn't change
# TODO(erikbern): revisit this once stub assignments have been disallowed
if not obj._is_another_app and (obj.object_id.startswith("fu-") or obj.object_id.startswith("cs-")):
# Persisted refs are ignored because their life cycle is managed independently.
# The same tag on an app can be pointed at different objects.
if existing_object_id is not None 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}"
)
# 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:
raise Exception(
f"Tried creating an object using existing id {existing_object_id}"
f" but it has id {obj.object_id}"
)

return obj

Expand Down

0 comments on commit d01ffa0

Please sign in to comment.