Skip to content

Commit

Permalink
Fix active workspace number
Browse files Browse the repository at this point in the history
  • Loading branch information
oeway committed Oct 11, 2024
1 parent 517a60e commit d4bd480
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion hypha/VERSION
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"version": "0.20.38.post4"
"version": "0.20.38.post5"
}
5 changes: 3 additions & 2 deletions hypha/core/workspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -1189,6 +1189,7 @@ async def load_workspace_info(self, workspace: str, load=True) -> WorkspaceInfo:
await self._redis.hset(
"workspaces", workspace_info.id, workspace_info.model_dump_json()
)
self._active_ws.inc()
await self._s3_controller.setup_workspace(workspace_info)
await self._event_bus.emit(
"workspace_loaded", workspace_info.model_dump()
Expand Down Expand Up @@ -1533,8 +1534,6 @@ async def unload(self, context=None):
# since the workspace will be persisted, we can remove the workspace info from the redis store
await self._redis.hdel("workspaces", ws)

self._active_ws.dec()

await self._event_bus.emit("workspace_unloaded", winfo.model_dump())
logger.info("Workspace %s unloaded.", ws)

Expand All @@ -1547,6 +1546,8 @@ async def unload(self, context=None):
if self._s3_controller:
await self._s3_controller.cleanup_workspace(winfo)

self._active_ws.dec()

@schema_method
async def cleanup(
self,
Expand Down

0 comments on commit d4bd480

Please sign in to comment.