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
+9-4Lines changed: 9 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -36,25 +36,30 @@ def lock_timeout=(value)
36
36
raise'Setting lock timeout to 0 disables the lock timeout and is dangerous'ifvalue == 0.seconds
37
37
38
38
unlessvalue.nil? || (value < safe_timeout && value <= max_lock_timeout_for_retry)
39
-
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})"
39
+
raiseArgumentError,"Lock timeout (#{value}) cannot be greater than the safe timeout (#{safe_timeout}) or the
40
+
max lock timeout for retry (#{max_lock_timeout_for_retry})"
40
41
end
41
42
42
43
@lock_timeout=value
43
44
end
44
45
45
46
defsafe_timeout=(value)
46
-
raise'Setting safe timeout to 0 or nil disables the safe timeout and is dangerous'unlessvalue && value > 0.seconds
47
+
unlessvalue && value > 0.seconds
48
+
raise'Setting safe timeout to 0 or nil disables the safe timeout and is dangerous'
49
+
end
47
50
48
51
unlesslock_timeout.nil? || (value > lock_timeout && value >= max_lock_timeout_for_retry)
49
-
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})"
52
+
raiseArgumentError,"Safe timeout (#{value}) cannot be lower than the lock timeout (#{lock_timeout}) or the
53
+
max lock timeout for retry (#{max_lock_timeout_for_retry})"
50
54
end
51
55
52
56
@safe_timeout=value
53
57
end
54
58
55
59
defmax_lock_timeout_for_retry=(value)
56
60
unlesslock_timeout.nil? || (value >= lock_timeout && value <= safe_timeout)
57
-
raiseArgumentError,"Max lock timeout for retry (#{value}) cannot be lower than the lock timeout (#{lock_timeout}) and greater than the safe timeout (#{safe_timeout})"
61
+
raiseArgumentError,"Max lock timeout for retry (#{value}) cannot be lower than the lock timeout
62
+
(#{lock_timeout}) and greater than the safe timeout (#{safe_timeout})"
0 commit comments