Skip to content

Commit

Permalink
Encourage best practice in sample code
Browse files Browse the repository at this point in the history
  • Loading branch information
akadusei committed Jun 16, 2024
1 parent f1bfc99 commit a9ccca8
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -557,8 +557,10 @@ struct SomeJob
def after_run(success)
return @progress.fail unless success
SomeStep.run(progress: @progress)
@progress.move(50) # <= Move to 50%
redis.multi do |redis|
SomeStep.run(redis: redis, progress: @progress)
@progress.move(50, redis) # <= Move to 50%
end
end
struct SomeStep
Expand All @@ -572,8 +574,10 @@ struct SomeJob
def after_run(success)
return @progress.fail unless success
SomeOtherStep.run(progress: @progress)
@progress.move(80) # <= Move to 80%
redis.multi do |redis|
SomeOtherStep.run(redis: redis, progress: @progress)
@progress.move(80, redis) # <= Move to 80%
end
end
end
Expand Down

0 comments on commit a9ccca8

Please sign in to comment.