From 92ba880006671a2f67e1c39a102589f7e8e35f4d Mon Sep 17 00:00:00 2001 From: nemunaire Date: Sat, 23 Jun 2018 15:45:32 +0200 Subject: [PATCH] sync: save import_report into StaticDir --- admin/main.go | 1 + admin/sync/full.go | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/admin/main.go b/admin/main.go index 1d9dc58d..9db71dad 100644 --- a/admin/main.go +++ b/admin/main.go @@ -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) } diff --git a/admin/sync/full.go b/admin/sync/full.go index 5c6f0d09..0b5fb6ae 100644 --- a/admin/sync/full.go +++ b/admin/sync/full.go @@ -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("))