From a9ccca84765fff65b2b3b43433dd192b24aa04c3 Mon Sep 17 00:00:00 2001 From: akadusei Date: Sun, 16 Jun 2024 16:48:09 +0000 Subject: [PATCH] Encourage best practice in sample code --- README.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 91b1baf..3681b9b 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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