diff --git a/Makefile b/Makefile index 2d234f9..86e36c3 100644 --- a/Makefile +++ b/Makefile @@ -8,6 +8,9 @@ build-image-dev: build-image-prod: - sh ${DEPLOY_DIR}/image-build.sh +push-image-dev: + - sh ${DEPLOY_DIR}/image-push.sh dev + push-image-prod: - sh ${DEPLOY_DIR}/image-push.sh diff --git a/src/cmd/migrate/main.go b/src/cmd/migrate/main.go index 8f15d9e..ddc2f0c 100644 --- a/src/cmd/migrate/main.go +++ b/src/cmd/migrate/main.go @@ -53,7 +53,7 @@ func main() { if err != nil { log.Fatalf("Error connecting to %s:%d. Err: %v", logHost, logPort, err) } - // defer logger.Close() + defer logger.Close() flag.Usage = usage flag.Parse() diff --git a/src/internal/config/config.go b/src/internal/config/config.go index badb206..b42aca0 100644 --- a/src/internal/config/config.go +++ b/src/internal/config/config.go @@ -13,7 +13,7 @@ const ( defCacheAddr = "api-cache:6379" defCachePassword = "12345678" defDbURL = "postgres://postgres:12345678@postgres-db:5432/egommerce" - defEventBusURL = "amqp://guest:guest@api-eventbus:56721" + defEventBusURL = "amqp://guest:guest@api-gateway:5672" defKVNmspc = "dev.egommerce/service/catalog" defLoggerAddr = "api-logger:24224" defNetAddr = ":80" diff --git a/src/internal/worker/worker.go b/src/internal/worker/worker.go index 775640e..629584a 100644 --- a/src/internal/worker/worker.go +++ b/src/internal/worker/worker.go @@ -242,6 +242,7 @@ func (w *Worker) processMsg(srvc *service.CatalogService, d amqp.Delivery) { } rnr := &CommandRunner{} + name := fmt.Sprintf("%s", msg["event"]) data := (msg["data"]).(map[string]interface{}) // reqID := (data["request_id"]).(string) // FIXME Check input params! @@ -257,16 +258,12 @@ func (w *Worker) processMsg(srvc *service.CatalogService, d amqp.Delivery) { ok, _ = rnr.run(data) if ok { w.Logger.Log("Successful executed message \"%s\"\n", name) + d.Ack(false) return } - if !ok { - w.Logger.Log("Error processing \"%s\": %s (%v)", name, err.Error(), err) - d.Reject(false) // FIXME: or Nack(repeat until success - maybe message shout know...? + w.Logger.Log("Error processing \"%s\": %s (%v)", name, err.Error(), err) + d.Reject(false) // FIXME: or Nack(repeat until success - maybe message shout know...? - return - } - - w.Logger.Log("Finalized processing: %s", name) - d.Ack(false) + return }