feat(config): support ActiveSupport::Duration for lock_ttl#934
feat(config): support ActiveSupport::Duration for lock_ttl#934
Conversation
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 0 minutes and 4 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe change adds duck-typing support to Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
LockTTL#calculate_timing raised ArgumentError for any type not in its explicit case branches (String, Numeric, Proc, Symbol). Since ActiveSupport::Duration is not a Numeric subclass, using `lock_ttl: 10.seconds` in sidekiq_options raised an error. Now any object responding to #to_i is accepted as a valid lock_ttl value, which supports ActiveSupport::Duration and other duration-like objects. Closes #908
1b7c5fd to
09e16ae
Compare
Closes #892
Summary
LockTTL#calculate_timingraisedArgumentErrorforActiveSupport::Durationbecause it's not aNumericsubclass#to_i, which supportsActiveSupport::Durationand similar duration-like objectsRange) that don't respond to#to_istill raiseArgumentErrorCloses #908
Test plan
#to_iis coerced correctly