From 5317cbe6e78f592198870b7fa3e242bc5be59f5f Mon Sep 17 00:00:00 2001 From: Piotr Biernat Date: Fri, 19 Jul 2024 22:46:43 +0200 Subject: [PATCH] fixes --- src/.gitignore | 1 - src/internal/worker/ext.go | 35 ----------------------------------- src/internal/worker/worker.go | 2 +- 3 files changed, 1 insertion(+), 37 deletions(-) delete mode 100644 src/internal/worker/ext.go diff --git a/src/.gitignore b/src/.gitignore index 94e30ce..47de0bc 100644 --- a/src/.gitignore +++ b/src/.gitignore @@ -13,6 +13,5 @@ *.out .env - # Dependency directories (remove the comment below to include it) vendor/ diff --git a/src/internal/worker/ext.go b/src/internal/worker/ext.go deleted file mode 100644 index 5d4c3d1..0000000 --- a/src/internal/worker/ext.go +++ /dev/null @@ -1,35 +0,0 @@ -package worker - -// func WithRegistry(c *cnf.Config) OptionFn { -// return func(w *Worker) error { -// registry, err := consul.NewService(c.RegistryAddr, c.Base.AppID, c.Base.AppName, c.Base.AppID, "", "", 0) -// if err != nil { -// w.Logger.Log("Error connecting to %s: %v", c.RegistryAddr, err) -// } - -// w.Registry = registry - -// go func(w *Worker) { // Fetch Consul KV config and store it in app config -// ticker := time.NewTicker(time.Second * 15) -// for range ticker.C { -// fetchKVConfig(w) // FIXME: duplicated in server -// } -// }(w) - -// return nil -// } - -// } - -// func fetchKVConfig(w *Worker) { // @FIXME: merge duplication in server.go and worker.go -// config, _, err := w.Registry.KV().Get(w.Config.KVNamespace, nil) -// if err != nil || config == nil { -// return -// } - -// kvCnf := bytes.NewBuffer(config.Value) -// decoder := json.NewDecoder(kvCnf) -// if err := decoder.Decode(&w.Config); err != nil { -// return -// } -// } diff --git a/src/internal/worker/worker.go b/src/internal/worker/worker.go index 704ee81..e84dcd7 100644 --- a/src/internal/worker/worker.go +++ b/src/internal/worker/worker.go @@ -125,7 +125,7 @@ func (w *Worker) doWork(while chan struct{}) error { w.services["catalog"] = service.NewCatalogService(w.GetDatabase(), w.GetEventBus(), w.GetLogger()) - cSrv := (w.services["catalog"]).(*service.CatalogService) // FIXME simplify maybe...? + cSrv := (w.services["catalog"]).(*service.CatalogService) msgs, err := w.GetEventBus().Consume( w.cnf.EventBusQueue, // queue