admin/sync: generate report on full import
This commit is contained in:
parent
3d59042802
commit
b4057c1a2c
@ -1,7 +1,12 @@
|
||||
package sync
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"log"
|
||||
"os"
|
||||
|
||||
"srs.epita.fr/fic-server/libfic"
|
||||
"srs.epita.fr/fic-server/settings"
|
||||
)
|
||||
|
||||
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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user