admin/sync: generate report on full import

This commit is contained in:
nemunaire 2017-12-12 07:09:29 +01:00 committed by Pierre-Olivier Mercier
parent 3d59042802
commit b4057c1a2c

View File

@ -1,7 +1,12 @@
package sync package sync
import ( import (
"encoding/json"
"log"
"os"
"srs.epita.fr/fic-server/libfic" "srs.epita.fr/fic-server/libfic"
"srs.epita.fr/fic-server/settings"
) )
func SyncDeep(i Importer) map[string][]string { func SyncDeep(i Importer) map[string][]string {
@ -23,5 +28,19 @@ func SyncDeep(i Importer) map[string][]string {
} }
} }
if fdto, err := os.Create("../htdocs-admin/full_import_report.json"); err == nil {
defer fdto.Close()
fdto.Write([]byte("disp("))
if out, err := json.Marshal(errs); err == nil {
fdto.Write(out)
} else {
log.Println(err)
}
fdto.Write([]byte(");"))
} else {
log.Println(err)
}
return errs return errs
} }