mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-24 02:20:13 +01:00
This commit is contained in:
parent
5bc1367b1c
commit
5bfa47d40c
1 changed files with 6 additions and 3 deletions
|
|
@ -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})
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue