Skip to content

Timeout when deleting registry + Add valid target for route creation #72

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Apr 12, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat: get targets of deployed functions without a start clean up
  • Loading branch information
redanrd committed Apr 11, 2023
commit a1b0f425c4b261ecda8eab6d962d713284f52a9f
12 changes: 1 addition & 11 deletions scw_serverless/gateway/gateway_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,6 @@ def update_routes(self) -> None:
if function.gateway_route
]

# The Gateway deletes routes based on the relative_url,
# so we need to cleanup all routes at the start,
# otherwise we might accidentally delete a route we previously created.
# If it has the same relative_url but different http methods.
for function in routed_functions:
function.gateway_route.target = "https://"
self.gateway_client.delete_route(function.gateway_route) # type: ignore

for function in routed_functions:
if function.name not in created_functions:
raise RuntimeError(
Expand All @@ -69,6 +61,4 @@ def update_routes(self) -> None:
function.gateway_route.target = target # type: ignore

for function in routed_functions:
if not function.gateway_route:
continue
self.gateway_client.create_route(function.gateway_route)
self.gateway_client.create_route(function.gateway_route) # type: ignore