Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
Vanessa 2023-01-08 23:32:37 +08:00
commit a0f92bd836

View file

@ -136,10 +136,13 @@ func getWorkspaces(c *gin.Context) {
var workspaces []*Workspace
for _, p := range workspacePaths {
closed := true
if flock.New(filepath.Join(p, ".lock")).Locked() {
closed = false
closed := false
f := flock.New(filepath.Join(p, ".lock"))
ok, _ := f.TryLock()
if ok {
closed = true
}
f.Unlock()
workspaces = append(workspaces, &Workspace{Path: p, Closed: closed})
}