You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: lib/safe-pg-migrations/configuration.rb
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -33,7 +33,7 @@ def initialize
33
33
deflock_timeout=(value)
34
34
raise'Setting lock timeout to 0 disables the lock timeout and is dangerous'ifvalue == 0.seconds
35
35
36
-
unlessvalue.nil? || (value < safe_timeout && value < max_lock_timeout_for_retry)
36
+
unlessvalue.nil? || (value < safe_timeout && value <=max_lock_timeout_for_retry)
37
37
raiseArgumentError,"Lock timeout (#{value}) cannot be greater than the safe timeout (#{safe_timeout}) or the max lock timeout for retry (#{max_lock_timeout_for_retry})"
38
38
end
39
39
@@ -43,15 +43,15 @@ def lock_timeout=(value)
43
43
defsafe_timeout=(value)
44
44
raise'Setting safe timeout to 0 or nil disables the safe timeout and is dangerous'unlessvalue && value > 0.seconds
45
45
46
-
unlesslock_timeout.nil? || (value > lock_timeout && value > max_lock_timeout_for_retry)
46
+
unlesslock_timeout.nil? || (value > lock_timeout && value >=max_lock_timeout_for_retry)
47
47
raiseArgumentError,"Safe timeout (#{value}) cannot be lower than the lock timeout (#{lock_timeout}) or the max lock timeout for retry (#{max_lock_timeout_for_retry})"
48
48
end
49
49
50
50
@safe_timeout=value
51
51
end
52
52
53
-
defmax_lock_timeout_for_retry(value)
54
-
unlesslock_timeout.nil? || (value > lock_timeout && value < safe_timeout)
53
+
defmax_lock_timeout_for_retry=(value)
54
+
unlesslock_timeout.nil? || (value >=lock_timeout && value <=safe_timeout)
55
55
raiseArgumentError,"Max lock timeout for retry (#{value}) cannot be lower than the lock timeout (#{lock_timeout}) and greater than the safe timeout (#{safe_timeout})"
0 commit comments