mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-03 04:50:59 +08:00
🎨 Improve ms defender check
This commit is contained in:
parent
3807f8386c
commit
4e7b0d1125
@ -43,7 +43,7 @@ func StartCron() {
|
||||
go every(30*time.Second, model.FlushAssetsTextsJob)
|
||||
go every(30*time.Second, model.HookDesktopUIProcJob)
|
||||
go every(24*time.Hour, model.AutoPurgeRepoJob)
|
||||
go every(30*time.Minute, model.AutoProcessMicrosoftDefender)
|
||||
go every(30*time.Minute, model.AutoCheckMicrosoftDefender)
|
||||
}
|
||||
|
||||
func every(interval time.Duration, f func()) {
|
||||
|
@ -21,6 +21,10 @@ package model
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/88250/gulu"
|
||||
"github.com/siyuan-note/logging"
|
||||
"github.com/siyuan-note/siyuan/kernel/util"
|
||||
"golang.org/x/sys/windows"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
@ -28,11 +32,7 @@ import (
|
||||
"strings"
|
||||
"sync"
|
||||
"syscall"
|
||||
|
||||
"github.com/88250/gulu"
|
||||
"github.com/siyuan-note/logging"
|
||||
"github.com/siyuan-note/siyuan/kernel/util"
|
||||
"golang.org/x/sys/windows"
|
||||
"time"
|
||||
)
|
||||
|
||||
var microsoftDefenderLock = sync.Mutex{}
|
||||
@ -98,11 +98,8 @@ func AddMicrosoftDefenderExclusion() (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
func AutoProcessMicrosoftDefender() {
|
||||
checkMicrosoftDefender()
|
||||
}
|
||||
|
||||
func checkMicrosoftDefender() {
|
||||
func AutoCheckMicrosoftDefender() {
|
||||
time.Sleep(7 * time.Second)
|
||||
microsoftDefenderLock.Lock()
|
||||
defer microsoftDefenderLock.Unlock()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user