diff --git a/yoda/handler.go b/yoda/handler.go index b12205bfc..ef6da75ec 100644 --- a/yoda/handler.go +++ b/yoda/handler.go @@ -60,11 +60,13 @@ func handleRequestLog(c *Context, l *Logger, log sdk.ABCIMessageLog) { return } - go handlePendingRequest(c, l, types.RequestID(id)) + go handleRequest(c, l, types.RequestID(id)) } } -func handlePendingRequest(c *Context, l *Logger, id types.RequestID) { +func handleRequest(c *Context, l *Logger, id types.RequestID) { + l = l.With("rid", id) + req, err := GetRequest(c, l, id) if err != nil { l.Error(":skull: Failed to get request with error: %s", c, err.Error()) @@ -83,7 +85,7 @@ func handlePendingRequest(c *Context, l *Logger, id types.RequestID) { return } - l.Info(":delivery_truck: Processing pending request") + l.Info(":delivery_truck: Processing request") keyIndex := c.nextKeyIndex() key := c.keys[keyIndex] diff --git a/yoda/run.go b/yoda/run.go index 40b5e445d..a40609688 100644 --- a/yoda/run.go +++ b/yoda/run.go @@ -69,7 +69,7 @@ func runImpl(c *Context, l *Logger) error { l.Info(":mag: Found %d pending requests", len(pendingRequests.RequestIDs)) for _, id := range pendingRequests.RequestIDs { c.pendingRequests[types.RequestID(id)] = true - go handlePendingRequest(c, l.With("rid", id), types.RequestID(id)) + go handleRequest(c, l, types.RequestID(id)) } for {