refactor(store): clone cached orphan slice

Co-Authored-By: Virgil <virgil@lethean.io>
This commit is contained in:
Virgil 2026-04-04 13:07:36 +00:00
parent dd4c9a2585
commit 85bef185e8

View file

@ -231,7 +231,7 @@ func (storeInstance *Store) RecoverOrphans(stateDirectory string) []*Workspace {
if stateDirectory == normaliseWorkspaceStateDirectory(defaultWorkspaceStateDirectory) {
storeInstance.orphanWorkspacesLock.Lock()
cachedWorkspaces := storeInstance.orphanWorkspaces
cachedWorkspaces := slices.Clone(storeInstance.orphanWorkspaces)
storeInstance.orphanWorkspaces = nil
storeInstance.orphanWorkspacesLock.Unlock()
if len(cachedWorkspaces) > 0 {