mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 14:40:12 +01:00
🎨 Improve the marketplace refresh timer https://github.com/siyuan-note/siyuan/issues/14685
This commit is contained in:
parent
9c970b1bdc
commit
85934230ac
4 changed files with 7 additions and 3 deletions
|
|
@ -32,6 +32,7 @@ func StartCron() {
|
||||||
go every(5*time.Second, task.StatusJob)
|
go every(5*time.Second, task.StatusJob)
|
||||||
go every(5*time.Second, model.SyncDataJob)
|
go every(5*time.Second, model.SyncDataJob)
|
||||||
go every(2*time.Hour, model.StatJob)
|
go every(2*time.Hour, model.StatJob)
|
||||||
|
go every(6*time.Hour, util.RefreshRhyResultJob)
|
||||||
go every(2*time.Hour, model.RefreshCheckJob)
|
go every(2*time.Hour, model.RefreshCheckJob)
|
||||||
go every(3*time.Second, model.FlushUpdateRefTextRenameDocJob)
|
go every(3*time.Second, model.FlushUpdateRefTextRenameDocJob)
|
||||||
go every(util.SQLFlushInterval, sql.FlushTxJob)
|
go every(util.SQLFlushInterval, sql.FlushTxJob)
|
||||||
|
|
@ -43,7 +44,7 @@ func StartCron() {
|
||||||
go every(30*time.Second, model.FlushAssetsTextsJob)
|
go every(30*time.Second, model.FlushAssetsTextsJob)
|
||||||
go every(30*time.Second, model.HookDesktopUIProcJob)
|
go every(30*time.Second, model.HookDesktopUIProcJob)
|
||||||
go every(24*time.Hour, model.AutoPurgeRepoJob)
|
go every(24*time.Hour, model.AutoPurgeRepoJob)
|
||||||
go every(30*time.Minute, model.AutoCheckMicrosoftDefender)
|
go every(30*time.Minute, model.AutoCheckMicrosoftDefenderJob)
|
||||||
|
|
||||||
// TODO: 移除旧方案 https://github.com/siyuan-note/siyuan/issues/14414 实现新的刷新机制
|
// TODO: 移除旧方案 https://github.com/siyuan-note/siyuan/issues/14414 实现新的刷新机制
|
||||||
//go every(3*time.Second, model.WatchLocalShorthands)
|
//go every(3*time.Second, model.WatchLocalShorthands)
|
||||||
|
|
|
||||||
|
|
@ -215,7 +215,6 @@ var (
|
||||||
)
|
)
|
||||||
|
|
||||||
func RefreshCheckJob() {
|
func RefreshCheckJob() {
|
||||||
go util.GetRhyResult(true) // 发一次请求进行结果缓存
|
|
||||||
go refreshSubscriptionExpirationRemind()
|
go refreshSubscriptionExpirationRemind()
|
||||||
go refreshUser()
|
go refreshUser()
|
||||||
go refreshAnnouncement()
|
go refreshAnnouncement()
|
||||||
|
|
|
||||||
|
|
@ -87,7 +87,7 @@ func AddMicrosoftDefenderExclusion() (err error) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func AutoCheckMicrosoftDefender() {
|
func AutoCheckMicrosoftDefenderJob() {
|
||||||
time.Sleep(7 * time.Second)
|
time.Sleep(7 * time.Second)
|
||||||
microsoftDefenderLock.Lock()
|
microsoftDefenderLock.Lock()
|
||||||
defer microsoftDefenderLock.Unlock()
|
defer microsoftDefenderLock.Unlock()
|
||||||
|
|
|
||||||
|
|
@ -58,3 +58,7 @@ func GetRhyResult(force bool) (map[string]interface{}, error) {
|
||||||
rhyResultCacheTime = now
|
rhyResultCacheTime = now
|
||||||
return cachedRhyResult, nil
|
return cachedRhyResult, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func RefreshRhyResultJob() {
|
||||||
|
GetRhyResult(true)
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue