Ìmprove handling of multiple rapid file changes

This commit is contained in:
2025-09-20 15:30:08 +02:00
parent 8c432bb834
commit f8f36b98db
6 changed files with 106 additions and 79 deletions

View File

@@ -6,6 +6,7 @@ import (
"git.blackforestbytes.com/BlackForestBytes/goext/exerr"
"github.com/fsnotify/fsnotify"
"mikescher.com/kpsync/assets"
)
func (app *Application) runSyncWatcher() error {
@@ -61,7 +62,10 @@ func (app *Application) runSyncWatcher() error {
continue
}
app.onDBFileChanged()
app.uploadWaiting.Set(true)
app.setTrayStateDirect("Uploading database (waiting)", assets.IconUpload)
app.LogInfo(fmt.Sprintf("Database file was modified - requesting upload (currently %d pending requests)", app.uploadDCI.CountPendingRequests()))
app.uploadDCI.Request()
case err := <-watcher.Errors:
app.LogError("Filewatcher reported an error", err)