diff pkg/imports/queue.go @ 1000:14425e35e3c2 persistent-import-queue

Wait with start of import queue until configuration is fully loaded.
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Mon, 22 Oct 2018 17:16:02 +0200
parents 75e65599ea52
children d789f19877f4
line wrap: on
line diff
--- a/pkg/imports/queue.go	Mon Oct 22 16:55:05 2018 +0200
+++ b/pkg/imports/queue.go	Mon Oct 22 17:16:02 2018 +0200
@@ -9,6 +9,7 @@
 	"sync"
 
 	"gemma.intevation.de/gemma/pkg/auth"
+	"gemma.intevation.de/gemma/pkg/config"
 )
 
 type (
@@ -219,6 +220,7 @@
 }
 
 func importLoop() {
+	config.WaitReady()
 	for {
 		queueCond.L.Lock()
 
@@ -259,7 +261,7 @@
 		if errDo != nil {
 			feedback.Error("error do: %v\n", errDo)
 		}
-		errCleanup := survive(job.CleanUp)
+		errCleanup := survive(job.CleanUp)()
 		if errCleanup != nil {
 			feedback.Error("error cleanup: %v\n", errCleanup)
 		}