sync: save import_report into StaticDir

This commit is contained in:
nemunaire 2018-06-23 15:45:32 +02:00 committed by Pierre-Olivier Mercier
parent e6b1b932f4
commit 92ba880006
2 changed files with 5 additions and 1 deletions

View File

@ -130,6 +130,7 @@ func main() {
if StaticDir, err = filepath.Abs(StaticDir); err != nil {
log.Fatal(err)
}
sync.DeepReportPath = path.Join(StaticDir, sync.DeepReportPath)
if fic.FilesDir, err = filepath.Abs(fic.FilesDir); err != nil {
log.Fatal(err)
}

View File

@ -12,6 +12,9 @@ import (
"srs.epita.fr/fic-server/settings"
)
// DeepReportPath stores the path to the report generated during full recursive import.
var DeepReportPath = "full_import_report.json"
// oneDeepSync ensure there is no more than one running deep sync.
var oneDeepSync sync.Mutex
@ -43,7 +46,7 @@ func SyncDeep(i Importer) (errs map[string][]string) {
errs["_regeneration"] = []string{}
if fdto, err := os.Create("../htdocs-admin/full_import_report.json"); err == nil {
if fdto, err := os.Create(DeepReportPath); err == nil {
defer fdto.Close()
fdto.Write([]byte("disp("))