File tree Expand file tree Collapse file tree 2 files changed +10
-8
lines changed Expand file tree Collapse file tree 2 files changed +10
-8
lines changed Original file line number Diff line number Diff line change 5
5
module SafePgMigrations
6
6
class Configuration
7
7
attr_accessor ( *%i[
8
+ backfill_batch_size
9
+ backfill_pause
8
10
blocking_activity_logger_margin
9
11
blocking_activity_logger_verbose
10
12
default_value_backfill_threshold
11
- backfill_batch_size
12
- backfill_pause
13
- retry_delay
13
+ lock_timeout
14
14
max_tries
15
15
max_lock_timeout
16
+ retry_delay
16
17
sensitive_logger
17
- lock_timeout
18
18
] )
19
19
attr_reader :safe_timeout
20
20
Original file line number Diff line number Diff line change @@ -21,10 +21,12 @@ def retry_if_lock_timeout
21
21
raise if transaction_open? # Retrying is useless if we're inside a transaction.
22
22
raise if number_of_retries >= SafePgMigrations . config . max_tries
23
23
24
- if SafePgMigrations . config . lock_timeout < SafePgMigrations . config . max_lock_timeout
25
- SafePgMigrations . config . lock_timeout = SafePgMigrations . config . lock_timeout * number_of_retries
26
- else
27
- SafePgMigrations . config . lock_timeout = SafePgMigrations . config . max_lock_timeout
24
+ unless SafePgMigrations . config . lock_timeout . nil?
25
+ if SafePgMigrations . config . lock_timeout < SafePgMigrations . config . max_lock_timeout
26
+ SafePgMigrations . config . lock_timeout = SafePgMigrations . config . lock_timeout * number_of_retries
27
+ else
28
+ SafePgMigrations . config . lock_timeout = SafePgMigrations . config . max_lock_timeout
29
+ end
28
30
end
29
31
30
32
retry_delay = SafePgMigrations . config . retry_delay
You can’t perform that action at this time.
0 commit comments