Comments (7)
Is that only for blocks? For a rescue ensure scenario in a method, the ensure part would only return something with an explicit return. Are blocks different?
from sidekiq-unique-jobs.
Try this in the console:
****from sidekiq-unique-jobs.
If the ensure part would indeed return something it would say "pokus" not "hokus".
from sidekiq-unique-jobs.
In our case I believe this happened:
irb(main):015:0* block = lambda do
irb(main):016:0* true
irb(main):017:0* "i don't know the return value" if false
irb(main):018:0* ensure
irb(main):019:0* false
irb(main):020:-> end
irb(main):021:-> pp block.call
nil
=> nil
If unlock succeeds everything works as you mentioned:
irb(main):022:0* block = lambda do
irb(main):023:0* true
irb(main):024:0* "i don't know the return value" if true
irb(main):025:0* ensure
irb(main):026:0* false
irb(main):027:-> end
"i don't know the return value"
=> "i don't know the return value"
from sidekiq-unique-jobs.
So maybe a different approach to solve this would be
def execute(&block)
with_logging_context do
executed = locksmith.execute do
yield
ensure
callback_safely if locksmith.unlock
end
unless executed
reflect(:execution_failed, item)
call_strategy(origin: :server, &block)
end
end
end
? To be honest I wasn't aware that the result of the ensure
block isn't the return value of the block ๐
from sidekiq-unique-jobs.
Ah now I see your problem doh ๐
from sidekiq-unique-jobs.
Thank you!
from sidekiq-unique-jobs.
Related Issues (20)
- Reaper manager registration is subject to race conditions HOT 1
- Should client middleware also be added to the Sidekiq server config? HOT 2
- After sidekiq shutdown (with running job) lock digest is not pushned back HOT 8
- Returning same job id HOT 7
- Sidekiq 7: Unsupported command argument type: TrueClass HOT 1
- register_reaper_process nx: true crash Sidekiq on startup HOT 2
- uniquejobs:digests sorted set seems to grow forever HOT 3
- should respond to `has_valid_sidekiq_options?` HOT 4
- Compatibility with Sidekiq7 HOT 4
- until_and_while_executing not entering perform method on initial run HOT 7
- No 'Changelog' link is being displayed on https://rubygems.org/gems/sidekiq-unique-jobs HOT 1
- Documentation of lock_ttl is inconsistent HOT 5
- Catched a deadlock on Sidekiq 7+ set up using middleware.
- Conflicts with sidekiq-lock gem HOT 4
- Read Timeouts and high CPU spike after upgrading from 8.0.5 to 8.0.10 HOT 9
- Issue with until_and_while_executing lock when job is not enqueued through sidekiq
- until_and_while_executing with separate server and client lock_args broken since 8.0.8 HOT 4
- Replace MD5 with SHA256+ HOT 2
- lock_prefix argument is not respected
- TypeError ยท Unsupported command argument type: Array HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sidekiq-unique-jobs.