mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
🎨 Support setting automatic sync interval https://github.com/siyuan-note/siyuan/issues/13448
This commit is contained in:
parent
152fa6e6e0
commit
45a6f7e29d
18 changed files with 100 additions and 12 deletions
|
|
@ -389,6 +389,20 @@ func SetSyncEnable(b bool) {
|
|||
return
|
||||
}
|
||||
|
||||
func SetSyncInterval(interval int) {
|
||||
if 30 > interval {
|
||||
interval = 30
|
||||
}
|
||||
if 43200 < interval {
|
||||
interval = 43200
|
||||
}
|
||||
|
||||
Conf.Sync.Interval = interval
|
||||
Conf.Save()
|
||||
planSyncAfter(time.Duration(interval) * time.Second)
|
||||
return
|
||||
}
|
||||
|
||||
func SetSyncPerception(b bool) {
|
||||
if util.ContainerDocker == util.Container {
|
||||
b = false
|
||||
|
|
@ -641,7 +655,7 @@ func getSyncIgnoreLines() (ret []string) {
|
|||
|
||||
func IncSync() {
|
||||
syncSameCount.Store(0)
|
||||
planSyncAfter(30 * time.Second)
|
||||
planSyncAfter(time.Duration(Conf.Sync.Interval) * time.Second)
|
||||
}
|
||||
|
||||
func planSyncAfter(d time.Duration) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue