Skip to content

Commit

Permalink
change function name, adjust log
Browse files Browse the repository at this point in the history
  • Loading branch information
RogerKSI committed Sep 12, 2023
1 parent 3156c5d commit 20a04b6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions yoda/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand All @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion yoda/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 20a04b6

Please sign in to comment.