fix: workspace delete MissingGreenlet + nginx cache-busting
- Convert WorkspaceHasInstancesError to store plain dicts instead of SQLAlchemy ORM objects, preventing lazy-load failures outside async session context (MissingGreenlet) - Update both delete endpoints (top-level and nested) to use exc.instances directly since they're already plain dicts - Add no-cache headers for index.html in nginx.conf so browsers always fetch new hashed JS/CSS bundles on deploy
This commit is contained in:
@@ -37,7 +37,7 @@ class SyncResult:
|
||||
class WorkspaceHasInstancesError(Exception):
|
||||
"""Raised when attempting to delete a workspace with running instances."""
|
||||
|
||||
def __init__(self, instances: list[ToolInstance]) -> None:
|
||||
def __init__(self, instances: list[dict]) -> None:
|
||||
self.instances = instances
|
||||
super().__init__(f"Workspace has {len(instances)} running tool instance(s)")
|
||||
|
||||
@@ -139,7 +139,9 @@ class WorkspaceManager:
|
||||
|
||||
instances = await self._get_instances(workspace, session)
|
||||
if instances and not force:
|
||||
raise WorkspaceHasInstancesError(instances)
|
||||
raise WorkspaceHasInstancesError(
|
||||
[{"id": str(i.id), "name": i.name} for i in instances]
|
||||
)
|
||||
|
||||
# Stop and delete all instances
|
||||
for instance in instances:
|
||||
|
||||
Reference in New Issue
Block a user