diff --git a/app/services/flu_logger_svc/logger.go b/app/services/flu_logger_svc/logger.go index 636cbc9aa983..75be5e7c1ecb 100644 --- a/app/services/flu_logger_svc/logger.go +++ b/app/services/flu_logger_svc/logger.go @@ -23,6 +23,15 @@ func LogStepError(flu models.FeedLineUnit, stepType step_type.StepType, errMsg s log(flu, 3, stepType, errMsg, retried) } +func LogRaw(fluLogs []models.FeedLineLog) { + + loggerChan := feed_line.GetFeedlineLoggerChannel() + + for _, fluLog := range fluLogs { + loggerChan.Push(fluLog) + } +} + func log(flu models.FeedLineUnit, event int, stepType step_type.StepType, message string, retried bool) { metaData := models.JsonF{"build": flu.Build} diff --git a/app/services/flu_svc/flu_output/flu_utils.go b/app/services/flu_svc/flu_output/flu_utils.go index 707c9c0b128c..2b2cea2b6890 100644 --- a/app/services/flu_svc/flu_output/flu_utils.go +++ b/app/services/flu_svc/flu_output/flu_utils.go @@ -10,6 +10,7 @@ import ( "github.com/crowdflux/angel/app/models" "github.com/crowdflux/angel/app/models/status_codes" "github.com/crowdflux/angel/app/plog" + "github.com/crowdflux/angel/app/services/flu_logger_svc" ) func ParseFluResponse(resp *http.Response) *FluResponse { @@ -98,6 +99,5 @@ func putDbLog(completedFLUs []models.FeedLineUnit, message string, resp FluRespo } dbLogArr[i] = dbLog } - err := dbLogger.Log(dbLogArr) - plog.Error("Flumonitor", err) + flu_logger_svc.LogRaw(dbLogArr) } diff --git a/app/services/work_flow_svc/work_flow_svc.go b/app/services/work_flow_svc/work_flow_svc.go index a4d1eda95e34..d562a7c659ee 100644 --- a/app/services/work_flow_svc/work_flow_svc.go +++ b/app/services/work_flow_svc/work_flow_svc.go @@ -6,6 +6,8 @@ import ( "github.com/crowdflux/angel/app/DAL/feed_line" "github.com/crowdflux/angel/app/models" + "github.com/crowdflux/angel/app/models/step_type" + "github.com/crowdflux/angel/app/services/flu_logger_svc" "github.com/crowdflux/angel/app/services/work_flow_svc/counter" "github.com/crowdflux/angel/app/services/work_flow_svc/work_flow" ) @@ -47,6 +49,9 @@ func startWorkflowSvc(w *workFlowSvc) { for flu := range w.OutQ.Receiver() { w.complete(flu.FeedLineUnit) flu.ConfirmReceive() + + //TODO put at correct place according to the architecture + flu_logger_svc.LogStepEntry(flu.FeedLineUnit, step_type.Gateway, flu.Redelivered()) } }() }