admin: Also fill lastSyncError in autosync

This commit is contained in:
nemunaire 2025-01-14 12:07:11 +01:00
parent 376e112130
commit c74eadc801

View File

@ -284,10 +284,12 @@ func autoSync(c *gin.Context) {
if !IsProductionEnv { if !IsProductionEnv {
if err := sync.GlobalImporter.Sync(); err != nil { if err := sync.GlobalImporter.Sync(); err != nil {
lastSyncError = err.Error()
log.Println("Unable to sync.GI.Sync:", err.Error()) log.Println("Unable to sync.GI.Sync:", err.Error())
c.AbortWithStatusJSON(http.StatusInternalServerError, gin.H{"errmsg": "Unable to perform the pull."}) c.AbortWithStatusJSON(http.StatusInternalServerError, gin.H{"errmsg": "Unable to perform the pull."})
return return
} }
lastSyncError = ""
} }
themes, err := fic.GetThemes() themes, err := fic.GetThemes()