admin: Add a route and a button to sync the filesystem

This commit is contained in:
nemunaire 2021-11-13 11:06:24 +01:00
parent a06602a7e8
commit 038abe450d
4 changed files with 27 additions and 6 deletions

View file

@ -56,6 +56,11 @@ func init() {
return map[string]interface{}{"progress": sync.DeepSyncProgress}, nil
}
}))
router.POST("/api/sync/base", apiHandler(
func(_ httprouter.Params, _ []byte) (interface{}, error) {
err := sync.GlobalImporter.Sync()
return true, err
}))
router.POST("/api/sync/speed", apiHandler(
func(_ httprouter.Params, _ []byte) (interface{}, error) {
st := sync.SpeedySyncDeep(sync.GlobalImporter)