Skip to content

Commit

Permalink
Merge pull request #2633 from OffchainLabs/redis_consumer_fix
Browse files Browse the repository at this point in the history
Redis consumer fix
  • Loading branch information
PlasmaPower authored Sep 5, 2024
2 parents 3e673d4 + 9a9515f commit 5828659
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions validator/valnode/redis/consumer.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,12 @@ func (s *ValidationServer) Start(ctx_in context.Context) {
req, err := c.Consume(ctx)
if err != nil {
log.Error("Consuming request", "error", err)
requestTokenQueue <- struct{}{}
return 0
}
if req == nil {
// There's nothing in the queue.
// There's nothing in the queue
requestTokenQueue <- struct{}{}
return time.Second
}
select {
Expand Down Expand Up @@ -152,9 +154,10 @@ func (s *ValidationServer) Start(ctx_in context.Context) {
res, err := valRun.Await(ctx)
if err != nil {
log.Error("Error validating", "request value", work.req.Value, "error", err)
}
if err := s.consumers[work.moduleRoot].SetResult(ctx, work.req.ID, res); err != nil {
log.Error("Error setting result for request", "id", work.req.ID, "result", res, "error", err)
} else {
if err := s.consumers[work.moduleRoot].SetResult(ctx, work.req.ID, res); err != nil {
log.Error("Error setting result for request", "id", work.req.ID, "result", res, "error", err)
}
}
select {
case <-ctx.Done():
Expand Down

0 comments on commit 5828659

Please sign in to comment.