Fix minor autosave race condition

This commit is contained in:
Zachary Yedidia
2019-08-04 14:32:42 -07:00
parent c0293b5d0e
commit f39a916e5f
2 changed files with 25 additions and 9 deletions

View File

@@ -406,9 +406,10 @@ func SetGlobalOptionNative(option string, nativeValue interface{}) error {
}
} else if option == "autosave" {
if nativeValue.(float64) > 0 {
config.SetAutoTime(int(nativeValue.(float64)))
config.StartAutoSave()
} else {
config.StopAutoSave()
config.SetAutoTime(0)
}
} else {
for _, pl := range config.Plugins {