Update
This commit is contained in:
parent
8fac6f7e61
commit
66acbb0cda
3
Makefile
3
Makefile
@ -8,6 +8,9 @@ build-image-dev:
|
|||||||
build-image-prod:
|
build-image-prod:
|
||||||
- sh ${DEPLOY_DIR}/image-build.sh
|
- sh ${DEPLOY_DIR}/image-build.sh
|
||||||
|
|
||||||
|
push-image-dev:
|
||||||
|
- sh ${DEPLOY_DIR}/image-push.sh dev
|
||||||
|
|
||||||
push-image-prod:
|
push-image-prod:
|
||||||
- sh ${DEPLOY_DIR}/image-push.sh
|
- sh ${DEPLOY_DIR}/image-push.sh
|
||||||
|
|
||||||
|
@ -53,7 +53,7 @@ func main() {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalf("Error connecting to %s:%d. Err: %v", logHost, logPort, err)
|
log.Fatalf("Error connecting to %s:%d. Err: %v", logHost, logPort, err)
|
||||||
}
|
}
|
||||||
// defer logger.Close()
|
defer logger.Close()
|
||||||
|
|
||||||
flag.Usage = usage
|
flag.Usage = usage
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
@ -13,7 +13,7 @@ const (
|
|||||||
defCacheAddr = "api-cache:6379"
|
defCacheAddr = "api-cache:6379"
|
||||||
defCachePassword = "12345678"
|
defCachePassword = "12345678"
|
||||||
defDbURL = "postgres://postgres:12345678@postgres-db:5432/egommerce"
|
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"
|
defKVNmspc = "dev.egommerce/service/catalog"
|
||||||
defLoggerAddr = "api-logger:24224"
|
defLoggerAddr = "api-logger:24224"
|
||||||
defNetAddr = ":80"
|
defNetAddr = ":80"
|
||||||
|
@ -242,6 +242,7 @@ func (w *Worker) processMsg(srvc *service.CatalogService, d amqp.Delivery) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
rnr := &CommandRunner{}
|
rnr := &CommandRunner{}
|
||||||
|
|
||||||
name := fmt.Sprintf("%s", msg["event"])
|
name := fmt.Sprintf("%s", msg["event"])
|
||||||
data := (msg["data"]).(map[string]interface{})
|
data := (msg["data"]).(map[string]interface{})
|
||||||
// reqID := (data["request_id"]).(string) // FIXME Check input params!
|
// 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)
|
ok, _ = rnr.run(data)
|
||||||
if ok {
|
if ok {
|
||||||
w.Logger.Log("Successful executed message \"%s\"\n", name)
|
w.Logger.Log("Successful executed message \"%s\"\n", name)
|
||||||
|
d.Ack(false)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if !ok {
|
w.Logger.Log("Error processing \"%s\": %s (%v)", name, err.Error(), err)
|
||||||
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...?
|
||||||
d.Reject(false) // FIXME: or Nack(repeat until success - maybe message shout know...?
|
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
|
||||||
|
|
||||||
w.Logger.Log("Finalized processing: %s", name)
|
|
||||||
d.Ack(false)
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user