瀏覽代碼

:art: 改进内核任务调度机制提升稳定性 https://github.com/siyuan-note/siyuan/issues/7113

Liang Ding 2 年之前
父節點
當前提交
e214543c86
共有 2 個文件被更改,包括 3 次插入4 次删除
  1. 3 2
      kernel/model/import.go
  2. 0 2
      kernel/model/mount.go

+ 3 - 2
kernel/model/import.go

@@ -31,7 +31,7 @@ import (
 	"os"
 	"path"
 	"path/filepath"
-	"runtime/debug"
+	"runtime"
 	"sort"
 	"strconv"
 	"strings"
@@ -708,8 +708,9 @@ func ImportFromLocalPath(boxID, localPath string, toPath string) (err error) {
 		}
 		IncSync()
 	}
-	debug.FreeOSMemory()
+
 	IncSync()
+	runtime.GC()
 	return
 }
 

+ 0 - 2
kernel/model/mount.go

@@ -21,7 +21,6 @@ import (
 	"fmt"
 	"os"
 	"path/filepath"
-	"runtime/debug"
 	"strings"
 	"time"
 	"unicode/utf8"
@@ -132,7 +131,6 @@ func unmount0(boxID string) {
 	boxConf.Closed = true
 	box.SaveConf(boxConf)
 	box.Unindex()
-	debug.FreeOSMemory()
 }
 
 func Mount(boxID string) (alreadyMount bool, err error) {