sync: Use errors instead of string to report
This commit is contained in:
parent
d8943ba1f3
commit
b0129e5239
9 changed files with 186 additions and 178 deletions
|
@ -31,7 +31,7 @@ func declareSyncRoutes(router *gin.RouterGroup) {
|
|||
// Speedy sync performs a recursive synchronization without importing files.
|
||||
apiSyncRoutes.POST("/speed", func(c *gin.Context) {
|
||||
st := sync.SpeedySyncDeep(sync.GlobalImporter)
|
||||
sync.EditDeepReport(st, false)
|
||||
sync.EditDeepReport(&st, false)
|
||||
c.JSON(http.StatusOK, st)
|
||||
})
|
||||
|
||||
|
@ -53,7 +53,7 @@ func declareSyncRoutes(router *gin.RouterGroup) {
|
|||
theme := c.MustGet("theme").(*fic.Theme)
|
||||
|
||||
st := sync.SyncThemeDeep(sync.GlobalImporter, theme, 0, 250)
|
||||
sync.EditDeepReport(map[string][]string{theme.Name: st}, false)
|
||||
sync.EditDeepReport(&sync.SyncReport{Themes: map[string][]error{theme.Name: st}}, false)
|
||||
sync.DeepSyncProgress = 255
|
||||
c.JSON(http.StatusOK, st)
|
||||
})
|
||||
|
@ -212,7 +212,7 @@ func autoSync(c *gin.Context) {
|
|||
}
|
||||
|
||||
st := sync.SyncThemeDeep(sync.GlobalImporter, theme, 0, 250)
|
||||
sync.EditDeepReport(map[string][]string{theme.Name: st}, false)
|
||||
sync.EditDeepReport(&sync.SyncReport{Themes: map[string][]error{theme.Name: st}}, false)
|
||||
sync.DeepSyncProgress = 255
|
||||
|
||||
settings.ForceRegeneration()
|
||||
|
|
Reference in a new issue