♻️ Remove unused param

This commit is contained in:
Liang Ding 2023-04-04 10:37:18 +08:00
parent 388e9cdf03
commit 334ad6b42e
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
3 changed files with 8 additions and 13 deletions

View file

@ -58,7 +58,7 @@ func performSync(c *gin.Context) {
}
if 3 != model.Conf.Sync.Mode {
model.SyncData(false, false, true)
model.SyncData(true)
return
}

View file

@ -450,7 +450,7 @@ func Close(force bool, execInstallPkg int) (exitCode int) {
if !force {
if Conf.Sync.Enabled && 3 != Conf.Sync.Mode &&
((IsSubscriber() && conf.ProviderSiYuan == Conf.Sync.Provider) || conf.ProviderSiYuan != Conf.Sync.Provider) {
syncData(false, true, false)
syncData(true, false)
if 0 != ExitSyncSucc {
exitCode = 1
return

View file

@ -126,7 +126,7 @@ func SyncDataJob() {
return
}
SyncData(false, false, false)
SyncData(false)
}
func BootSyncData() {
@ -170,19 +170,19 @@ func BootSyncData() {
return
}
func SyncData(boot, exit, byHand bool) {
syncData(boot, exit, byHand)
func SyncData(byHand bool) {
syncData(false, byHand)
}
func syncData(boot, exit, byHand bool) {
func syncData(exit, byHand bool) {
defer logging.Recover()
if !checkSync(boot, exit, byHand) {
if !checkSync(false, exit, byHand) {
return
}
util.BroadcastByType("main", "syncing", 0, Conf.Language(81), nil)
if !isProviderOnline() { // 这个操作比较耗时,所以要先推送 syncing 事件后再判断网络,这样才能给用户更即时的反馈
if !exit && !isProviderOnline() { // 这个操作比较耗时,所以要先推送 syncing 事件后再判断网络,这样才能给用户更即时的反馈
util.BroadcastByType("main", "syncing", 2, Conf.Language(28), nil)
return
}
@ -190,11 +190,6 @@ func syncData(boot, exit, byHand bool) {
syncLock.Lock()
defer syncLock.Unlock()
if boot {
util.IncBootProgress(3, "Syncing data from the cloud...")
BootSyncSucc = 0
logging.LogInfof("sync before boot")
}
if exit {
ExitSyncSucc = 0
logging.LogInfof("sync before exit")