From 7e2b171392582e5427b8c7eb7d808087e9302de0 Mon Sep 17 00:00:00 2001 From: Matthew Scerri <32162885+scermat@users.noreply.github.com> Date: Sat, 27 Jul 2024 04:47:37 +0200 Subject: [PATCH 1/9] updated logs to display app id that has exceeded balance --- gateway/plugins/balance.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gateway/plugins/balance.go b/gateway/plugins/balance.go index e416729..a987756 100644 --- a/gateway/plugins/balance.go +++ b/gateway/plugins/balance.go @@ -66,7 +66,7 @@ func (b *BalanceTracker) HandleRequest(req *http.Request) error { lifecycle := proxy.SetStageComplete(ctx, proxy.BalanceCheck|proxy.AccountLookup) ctx = common.UpdateContext(ctx, lifecycle) } else { - log.Error("no balance remaining", "app", app.HashId()) + log.Error("no balance remaining", "app", app.Id) return proxy.BalanceExceededError } From 10cfa3e84e0bdddeee3d6a187301bb053d9bf5c8 Mon Sep 17 00:00:00 2001 From: Matthew Scerri <32162885+scermat@users.noreply.github.com> Date: Sat, 27 Jul 2024 04:54:01 +0200 Subject: [PATCH 2/9] investigating issue with balance reporting --- gateway/plugins/balance.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gateway/plugins/balance.go b/gateway/plugins/balance.go index a987756..35a75dc 100644 --- a/gateway/plugins/balance.go +++ b/gateway/plugins/balance.go @@ -58,9 +58,11 @@ func (b *BalanceTracker) HandleRequest(req *http.Request) error { if err != nil { return proxy.NewHTTPError(http.StatusNotFound) } + ctx = common.UpdateContext(ctx, bal) ctx = common.UpdateContext(ctx, app) - // TODO Check that balance is greater than or equal to req weight + + log.Info("Balance for app", "appId", app.Id, "bal", bal) if bal.cachedBalance > 0 { lifecycle := proxy.SetStageComplete(ctx, proxy.BalanceCheck|proxy.AccountLookup) From c736edbd5dabc72da49140eb47e7266c5ea76eeb Mon Sep 17 00:00:00 2001 From: Matthew Scerri <32162885+scermat@users.noreply.github.com> Date: Sat, 27 Jul 2024 05:03:55 +0200 Subject: [PATCH 3/9] further logging to investigate balance mismatch --- gateway/plugins/balance.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/gateway/plugins/balance.go b/gateway/plugins/balance.go index 35a75dc..369c417 100644 --- a/gateway/plugins/balance.go +++ b/gateway/plugins/balance.go @@ -62,7 +62,7 @@ func (b *BalanceTracker) HandleRequest(req *http.Request) error { ctx = common.UpdateContext(ctx, bal) ctx = common.UpdateContext(ctx, app) - log.Info("Balance for app", "appId", app.Id, "bal", bal) + log.Info("Balance for app", "appId", app.Id, "bal", bal.cachedBalance) if bal.cachedBalance > 0 { lifecycle := proxy.SetStageComplete(ctx, proxy.BalanceCheck|proxy.AccountLookup) @@ -86,14 +86,19 @@ func (c *balancecache) ContextKey() string { } func (c *balancecache) Lookup(ctx context.Context) error { + log.Info("Balance Lookup", "key", c.Key(), "balance", c.tenant.Balance); + created, err := db.InitCounter(ctx, c.Key(), c.tenant.Balance) if err != nil { + log.Error("Error on db.InitCounter", "key", c.Key(), "balance", c.tenant.Balance) return err } if created { - c.cachedBalance = c.tenant.Balance + c.cachedBalance = c.tenant.Balance + log.Info("Balance Lookup Created", "balance", c.tenant.Balance) } else { c.cachedBalance = db.GetIntVal(ctx, c.Key()) + log.Info("Balance Lookup Exists", "key", c.Key(), "balance", c.cachedBalance) } return nil } From 470030e60fe94e04afc3be5c3db8a63287358e15 Mon Sep 17 00:00:00 2001 From: Matthew Scerri <32162885+scermat@users.noreply.github.com> Date: Sat, 27 Jul 2024 05:04:47 +0200 Subject: [PATCH 4/9] cleaned logging --- gateway/db/cache.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gateway/db/cache.go b/gateway/db/cache.go index 1b9b113..a0889b9 100644 --- a/gateway/db/cache.go +++ b/gateway/db/cache.go @@ -391,7 +391,8 @@ func (a *App) refresh(ctx context.Context) error { log.Debug("Refreshing app", "appId", a.Id) err := a.fetch(ctx) if err != nil { - log.Error("Failed to fetch app", "appId", a.Id, "error", err) + //Can be set to log.Error, but lots of false positives will show due to context cancellation + log.Debug("Failed to fetch app", "appId", a.Id, "error", err) a.MissedAt = time.Now() } else { log.Debug("Updating Tenant via Lookup") @@ -400,7 +401,8 @@ func (a *App) refresh(ctx context.Context) error { err = a.cache(ctx) if err != nil { - log.Error("Failed to cache app", "appId", a.Id, "error", err) + //Can be set to log.Error, but lots of false positives will show due to context cancellation + log.Debug("Failed to cache app", "appId", a.Id, "error", err) return err } From 4b59cde2fb4fe679e61fb563ea8f5f4e96069385 Mon Sep 17 00:00:00 2001 From: Matthew Scerri <32162885+scermat@users.noreply.github.com> Date: Sat, 27 Jul 2024 05:34:39 +0200 Subject: [PATCH 5/9] attempting temporary fix, until further investigation --- gateway/plugins/balance.go | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/gateway/plugins/balance.go b/gateway/plugins/balance.go index 369c417..c7577a0 100644 --- a/gateway/plugins/balance.go +++ b/gateway/plugins/balance.go @@ -86,19 +86,21 @@ func (c *balancecache) ContextKey() string { } func (c *balancecache) Lookup(ctx context.Context) error { - log.Info("Balance Lookup", "key", c.Key(), "balance", c.tenant.Balance); + // log.Info("Balance Lookup", "key", c.Key(), "balance", c.tenant.Balance); + + // created, err := db.InitCounter(ctx, c.Key(), c.tenant.Balance) + // if err != nil { + // log.Error("Error on db.InitCounter", "key", c.Key(), "balance", c.tenant.Balance) + // return err + // } + // if created { + // c.cachedBalance = c.tenant.Balance + // log.Info("Balance Lookup Created", "balance", c.tenant.Balance) + // } else { + // c.cachedBalance = db.GetIntVal(ctx, c.Key()) + // log.Info("Balance Lookup Exists", "key", c.Key(), "balance", c.cachedBalance) + // } + c.cachedBalance = c.tenant.Balance - created, err := db.InitCounter(ctx, c.Key(), c.tenant.Balance) - if err != nil { - log.Error("Error on db.InitCounter", "key", c.Key(), "balance", c.tenant.Balance) - return err - } - if created { - c.cachedBalance = c.tenant.Balance - log.Info("Balance Lookup Created", "balance", c.tenant.Balance) - } else { - c.cachedBalance = db.GetIntVal(ctx, c.Key()) - log.Info("Balance Lookup Exists", "key", c.Key(), "balance", c.cachedBalance) - } return nil } From c15ebf528880333375bf0dd214e202ec6e75c530 Mon Sep 17 00:00:00 2001 From: Matthew Scerri <32162885+scermat@users.noreply.github.com> Date: Sat, 27 Jul 2024 17:57:05 +0200 Subject: [PATCH 6/9] updated functions to correctly update balance --- gateway/db/cache.go | 32 ++++++++++++++++++++++++++------ gateway/db/usage.go | 7 ++++--- gateway/main.go | 30 +++++++++++++++--------------- gateway/plugins/balance.go | 15 --------------- gateway/plugins/counter.go | 22 +++++++++++----------- 5 files changed, 56 insertions(+), 50 deletions(-) diff --git a/gateway/db/cache.go b/gateway/db/cache.go index a0889b9..26997aa 100644 --- a/gateway/db/cache.go +++ b/gateway/db/cache.go @@ -515,7 +515,7 @@ func DecrementField(ctx context.Context, decr Decrementable, amount int) int { return int(newVal) } -func IncrementCounter(ctx context.Context, key string, amount int) int { +func IncrementCounterKey(ctx context.Context, key string, amount int) int { incrBy := int64(amount) newVal, err := getCache().IncrBy(ctx, key, incrBy).Result() if err != nil { @@ -524,18 +524,38 @@ func IncrementCounter(ctx context.Context, key string, amount int) int { return int(newVal) } -func DecrementCounter(ctx context.Context, key string, amount int) int { +func IncrementCounterField(ctx context.Context, key string, field string, amount int) int { + incrBy := int64(amount) + + newVal, err := getCache().HIncrBy(ctx, key, field, incrBy).Result() + if err != nil { + log.Error("Error incrementing counter", "key", key, "field", field, "amount", amount, "error", err) + return -1 + } + log.Info("Incremented counter", "key", key, "field", field, "newVal", newVal) + return int(newVal) +} + +func DecrementCounterField(ctx context.Context, key string, field string, amount int) int { decrBy := int64(amount) - newVal, err := getCache().DecrBy(ctx, key, decrBy).Result() + + newVal, err := getCache().HIncrBy(ctx, key, field, -decrBy).Result() if err != nil { + log.Error("Error decrementing counter", "key", key, "field", field, "amount", amount, "error", err) return -1 } + log.Info("Decremented counter", "key", key, "field", field, "newVal", newVal) return int(newVal) } -// returns false if counter already exists -func InitCounter(ctx context.Context, key string, initValue int) (bool, error) { - return getCache().SetNX(ctx, key, initValue, 2*time.Minute).Result() +func InitCounter(ctx context.Context, key string, field string, initValue int) (bool, error) { + success, err := getCache().HSetNX(ctx, key, field, initValue).Result() + if err != nil { + log.Error("Error initializing counter", "key", key, "field", field, "initValue", initValue, "error", err) + return false, err + } + log.Info("Initialized counter", "key", key, "field", field, "success", success) + return success, nil } func ReconcileRelays(ctx context.Context, rtx *Relaytx) (func() bool, error) { diff --git a/gateway/db/usage.go b/gateway/db/usage.go index 6193424..dd05c94 100644 --- a/gateway/db/usage.go +++ b/gateway/db/usage.go @@ -18,7 +18,8 @@ type UsageUpdater struct { func NewUsageUpdater(ctx context.Context, status string) *UsageUpdater { updater := &UsageUpdater{ - status: status, + status: status, + balancekey: "balance", } entity, ok := common.FromContext(ctx, PRODUCT) @@ -53,13 +54,13 @@ func (u *UsageUpdater) Run() { if u.status == "success" { ctx := context.Background() - DecrementCounter(ctx, u.balancekey, u.product.Weight) + DecrementCounterField(ctx, u.app.Tenant.Key(), u.balancekey, u.product.Weight) use := &Relaytx{ AppId: u.app.Id, ProductName: u.product.Name, } - IncrementCounter(ctx, use.Key(), u.product.Weight) + IncrementCounterField(ctx, use.Key(), u.balancekey, u.product.Weight) } common.EndpointUsage.WithLabelValues(u.app.HashId(), u.app.Tenant.Id, u.product.Name, u.status).Inc() } diff --git a/gateway/main.go b/gateway/main.go index 4e07d3c..b1be88d 100644 --- a/gateway/main.go +++ b/gateway/main.go @@ -1,27 +1,27 @@ package main import ( - "os" + "os" - "porters/plugins" - "porters/proxy" + "porters/plugins" + "porters/proxy" ) // command line runner func main() { - arg := os.Args[1] - if arg == "gateway" { + arg := os.Args[1] + if arg == "gateway" { - // currently registering plugins via main - proxy.Register(&plugins.ApiKeyAuth{"X-API"}) - proxy.Register(&plugins.BalanceTracker{}) - proxy.Register(&plugins.LeakyBucketPlugin{"APP"}) - proxy.Register(&plugins.ProductFilter{}) - proxy.Register(&plugins.UserAgentFilter{}) - proxy.Register(&plugins.AllowedOriginFilter{}) - proxy.Register(proxy.NewReconciler(300)) // seconds + // currently registering plugins via main + proxy.Register(&plugins.ApiKeyAuth{"X-API"}) + proxy.Register(&plugins.BalanceTracker{}) + proxy.Register(&plugins.LeakyBucketPlugin{"APP"}) + proxy.Register(&plugins.ProductFilter{}) + proxy.Register(&plugins.UserAgentFilter{}) + proxy.Register(&plugins.AllowedOriginFilter{}) + proxy.Register(proxy.NewReconciler(300)) // seconds - gateway() - } + gateway() + } } diff --git a/gateway/plugins/balance.go b/gateway/plugins/balance.go index c7577a0..cc9533f 100644 --- a/gateway/plugins/balance.go +++ b/gateway/plugins/balance.go @@ -86,21 +86,6 @@ func (c *balancecache) ContextKey() string { } func (c *balancecache) Lookup(ctx context.Context) error { - // log.Info("Balance Lookup", "key", c.Key(), "balance", c.tenant.Balance); - - // created, err := db.InitCounter(ctx, c.Key(), c.tenant.Balance) - // if err != nil { - // log.Error("Error on db.InitCounter", "key", c.Key(), "balance", c.tenant.Balance) - // return err - // } - // if created { - // c.cachedBalance = c.tenant.Balance - // log.Info("Balance Lookup Created", "balance", c.tenant.Balance) - // } else { - // c.cachedBalance = db.GetIntVal(ctx, c.Key()) - // log.Info("Balance Lookup Exists", "key", c.Key(), "balance", c.cachedBalance) - // } c.cachedBalance = c.tenant.Balance - return nil } diff --git a/gateway/plugins/counter.go b/gateway/plugins/counter.go index 0aca00c..850e6dd 100644 --- a/gateway/plugins/counter.go +++ b/gateway/plugins/counter.go @@ -1,33 +1,33 @@ package plugins import ( - log "log/slog" - "net/http" + log "log/slog" + "net/http" - "porters/db" + "porters/db" ) -type Counter struct {} +type Counter struct{} func (c Counter) Load() { - log.Debug("loading plugin", "plugin", c.Name()) + log.Debug("loading plugin", "plugin", c.Name()) } func (c Counter) Name() string { - return "Request Counter" + return "Request Counter" } func (c Counter) Key() string { - return "COUNTER" + return "COUNTER" } func (c Counter) Field() string { - return "requests" + return "requests" } // Just count all requests func (c Counter) HandleResponse(resp *http.Response) error { - newCount := db.IncrementCounter(resp.Request.Context(), c.Key(), 1) - log.Debug("counting request", "count", newCount) - return nil + newCount := db.IncrementCounterKey(resp.Request.Context(), c.Key(), 1) + log.Debug("counting request", "count", newCount) + return nil } From db0015c4ba838793a973e90a71b7b9f3a4fbc0db Mon Sep 17 00:00:00 2001 From: Matthew Scerri <32162885+scermat@users.noreply.github.com> Date: Sat, 27 Jul 2024 19:26:05 +0200 Subject: [PATCH 7/9] fixed issue with incorrect action for key and cleaned logs --- gateway/db/cache.go | 5 ++--- gateway/db/usage.go | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/gateway/db/cache.go b/gateway/db/cache.go index 26997aa..b36edfe 100644 --- a/gateway/db/cache.go +++ b/gateway/db/cache.go @@ -519,6 +519,7 @@ func IncrementCounterKey(ctx context.Context, key string, amount int) int { incrBy := int64(amount) newVal, err := getCache().IncrBy(ctx, key, incrBy).Result() if err != nil { + log.Error("Error incrementing counter (key)", "key", key, "amount", amount, "error", err) return -1 } return int(newVal) @@ -529,10 +530,9 @@ func IncrementCounterField(ctx context.Context, key string, field string, amount newVal, err := getCache().HIncrBy(ctx, key, field, incrBy).Result() if err != nil { - log.Error("Error incrementing counter", "key", key, "field", field, "amount", amount, "error", err) + log.Error("Error incrementing counter (field)", "key", key, "field", field, "amount", amount, "error", err) return -1 } - log.Info("Incremented counter", "key", key, "field", field, "newVal", newVal) return int(newVal) } @@ -544,7 +544,6 @@ func DecrementCounterField(ctx context.Context, key string, field string, amount log.Error("Error decrementing counter", "key", key, "field", field, "amount", amount, "error", err) return -1 } - log.Info("Decremented counter", "key", key, "field", field, "newVal", newVal) return int(newVal) } diff --git a/gateway/db/usage.go b/gateway/db/usage.go index dd05c94..2ff75fb 100644 --- a/gateway/db/usage.go +++ b/gateway/db/usage.go @@ -60,7 +60,7 @@ func (u *UsageUpdater) Run() { AppId: u.app.Id, ProductName: u.product.Name, } - IncrementCounterField(ctx, use.Key(), u.balancekey, u.product.Weight) + IncrementCounterKey(ctx, use.Key(), u.product.Weight) } common.EndpointUsage.WithLabelValues(u.app.HashId(), u.app.Tenant.Id, u.product.Name, u.status).Inc() } From ee1196d0d708f746f3fd91aa8eaa3e607eb4214c Mon Sep 17 00:00:00 2001 From: Matthew Scerri <32162885+scermat@users.noreply.github.com> Date: Sat, 27 Jul 2024 19:29:54 +0200 Subject: [PATCH 8/9] added confiditional logging of response for debugging --- gateway/common/config.go | 152 ++++++++++++++++++++------------------- gateway/proxy/proxy.go | 6 +- 2 files changed, 82 insertions(+), 76 deletions(-) diff --git a/gateway/common/config.go b/gateway/common/config.go index 48aee7c..92f4bd4 100644 --- a/gateway/common/config.go +++ b/gateway/common/config.go @@ -1,113 +1,115 @@ package common import ( - log "log/slog" - "os" - "strconv" - "strings" - "sync" + log "log/slog" + "os" + "strconv" + "strings" + "sync" ) // store config as constants for now const ( - SHUTDOWN_DELAY string = "SHUTDOWN_DELAY" - JOB_BUFFER_SIZE = "JOB_BUFFER_SIZE" - NUM_WORKERS = "NUM_WORKERS" - PROXY_TO = "PROXY_TO" - HOST = "HOST" // host to add subdomains to - PORT = "PORT" - DATABASE_URL = "DATABASE_URL" - REDIS_URL = "REDIS_URL" - REDIS_ADDR = "REDIS_ADDR" - REDIS_USER = "REDIS_USER" - REDIS_PASSWORD = "REDIS_PASSWORD" - INSTRUMENT_ENABLED = "ENABLE_INSTRUMENT" - LOG_LEVEL = "LOG_LEVEL" + SHUTDOWN_DELAY string = "SHUTDOWN_DELAY" + JOB_BUFFER_SIZE = "JOB_BUFFER_SIZE" + NUM_WORKERS = "NUM_WORKERS" + PROXY_TO = "PROXY_TO" + HOST = "HOST" // host to add subdomains to + PORT = "PORT" + DATABASE_URL = "DATABASE_URL" + REDIS_URL = "REDIS_URL" + REDIS_ADDR = "REDIS_ADDR" + REDIS_USER = "REDIS_USER" + REDIS_PASSWORD = "REDIS_PASSWORD" + INSTRUMENT_ENABLED = "ENABLE_INSTRUMENT" + LOG_LEVEL = "LOG_LEVEL" + LOG_HTTP_RESPONSE = "LOG_HTTP_RESPONSE" ) // This may evolve to include config outside env, or use .env file for // convenience type Config struct { - defaults map[string]string - loglevel *log.LevelVar + defaults map[string]string + loglevel *log.LevelVar } var config *Config var configMutex sync.Once func setupConfig() *Config { - configMutex.Do(func() { - config = &Config{ - defaults: make(map[string]string), - loglevel: &log.LevelVar{}, - } - config.defaults[SHUTDOWN_DELAY] = "5" - config.defaults[JOB_BUFFER_SIZE] = "50" - config.defaults[NUM_WORKERS] = "10" - config.defaults[HOST] = "localhost" - config.defaults[PORT] = "9000" - config.defaults[INSTRUMENT_ENABLED] = "false" + configMutex.Do(func() { + config = &Config{ + defaults: make(map[string]string), + loglevel: &log.LevelVar{}, + } + config.defaults[SHUTDOWN_DELAY] = "5" + config.defaults[JOB_BUFFER_SIZE] = "50" + config.defaults[NUM_WORKERS] = "10" + config.defaults[HOST] = "localhost" + config.defaults[PORT] = "9000" + config.defaults[INSTRUMENT_ENABLED] = "false" + config.defaults[LOG_HTTP_RESPONSE] = "true" - level := parseLogLevel(os.Getenv(LOG_LEVEL)) - config.SetLogLevel(level) - }) - return config + level := parseLogLevel(os.Getenv(LOG_LEVEL)) + config.SetLogLevel(level) + }) + return config } func GetConfig(key string) string { - config := setupConfig() - value, ok := os.LookupEnv(key) - if ok { - return value - } else { - defaultval, ok := config.defaults[key] - if ok { - return defaultval - } else { - log.Warn("config not set, no default", "key", key) - return "" - } - } + config := setupConfig() + value, ok := os.LookupEnv(key) + if ok { + return value + } else { + defaultval, ok := config.defaults[key] + if ok { + return defaultval + } else { + log.Warn("config not set, no default", "key", key) + return "" + } + } } func GetConfigInt(key string) int { - configval := GetConfig(key) - intval, err := strconv.Atoi(configval) - if err != nil { - log.Error("Error parsing config", "err", err) - intval = -1 - } - return intval + configval := GetConfig(key) + intval, err := strconv.Atoi(configval) + if err != nil { + log.Error("Error parsing config", "err", err) + intval = -1 + } + return intval } func Enabled(key string) bool { - configval := GetConfig(key) - boolval, err := strconv.ParseBool(configval) - if err != nil { - boolval = false - } - return boolval + configval := GetConfig(key) + boolval, err := strconv.ParseBool(configval) + if err != nil { + boolval = false + } + return boolval } func GetLogLevel() log.Level { - configval := GetConfig(LOG_LEVEL) - return parseLogLevel(configval) + configval := GetConfig(LOG_LEVEL) + return parseLogLevel(configval) } func parseLogLevel(level string) log.Level { - if strings.EqualFold(level, "ERROR") { - return log.LevelError - } else if strings.EqualFold(level, "WARN") { - return log.LevelWarn - } else if strings.EqualFold(level, "DEBUG") { - return log.LevelDebug - } else { - return log.LevelInfo - } + if strings.EqualFold(level, "ERROR") { + return log.LevelError + } else if strings.EqualFold(level, "WARN") { + return log.LevelWarn + } else if strings.EqualFold(level, "DEBUG") { + return log.LevelDebug + } else { + return log.LevelInfo + } } func (c *Config) SetLogLevel(level log.Level) { - c.loglevel.Set(level) - logger := log.New(log.NewTextHandler(os.Stdout, &log.HandlerOptions{Level: c.loglevel})) - log.SetDefault(logger) + c.loglevel.Set(level) + logger := log.New(log.NewTextHandler(os.Stdout, &log.HandlerOptions{Level: c.loglevel})) + log.SetDefault(logger) } diff --git a/gateway/proxy/proxy.go b/gateway/proxy/proxy.go index 7cd9786..f0ddae8 100644 --- a/gateway/proxy/proxy.go +++ b/gateway/proxy/proxy.go @@ -155,7 +155,11 @@ func setupProxy(remote *url.URL) *httputil.ReverseProxy { } if resp.StatusCode < 400 && err == nil { - log.Info("Success response", "resp", resp) + + if common.Enabled(common.LOG_HTTP_RESPONSE) { + log.Info("Success response", "resp", resp) + } + updater := db.NewUsageUpdater(ctx, "success") common.GetTaskQueue().Add(updater) } From e3118a4a701262d098c20a8383b4a18eb409ad90 Mon Sep 17 00:00:00 2001 From: Matthew Scerri <32162885+scermat@users.noreply.github.com> Date: Mon, 5 Aug 2024 19:15:55 +0200 Subject: [PATCH 9/9] updated logging for reconclier --- gateway/proxy/reconciler.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gateway/proxy/reconciler.go b/gateway/proxy/reconciler.go index 88db16e..c4294ba 100644 --- a/gateway/proxy/reconciler.go +++ b/gateway/proxy/reconciler.go @@ -49,7 +49,12 @@ func (r *Reconciler) spawnTasks() { log.Debug("Reconciling tasks for key", "rtxkey", rtxkey) rtx, ok := db.RelaytxFromKey(ctx, rtxkey) + if ok { + if rtx.Amount != 0 { + log.Info("Reconciling transactions for", "key", rtxkey) + } + task := &reconcileTask{ relaytx: rtx, }