Browse Source

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

Liang Ding 2 years ago
parent
commit
e214543c86
2 changed files with 3 additions and 4 deletions
  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"
 	"os"
 	"path"
 	"path"
 	"path/filepath"
 	"path/filepath"
-	"runtime/debug"
+	"runtime"
 	"sort"
 	"sort"
 	"strconv"
 	"strconv"
 	"strings"
 	"strings"
@@ -708,8 +708,9 @@ func ImportFromLocalPath(boxID, localPath string, toPath string) (err error) {
 		}
 		}
 		IncSync()
 		IncSync()
 	}
 	}
-	debug.FreeOSMemory()
+
 	IncSync()
 	IncSync()
+	runtime.GC()
 	return
 	return
 }
 }
 
 

+ 0 - 2
kernel/model/mount.go

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