Skip to content

Commit 987edfb

Browse files
committed
Move private client constants further down the file
A very inconsequential change to move private client constants further down the file so they're somewhat deranked, and closer to the class' private methods.
1 parent f8b3e6a commit 987edfb

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

lib/client.rb

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,6 @@ def initialize(driver, advisory_lock_prefix: nil)
2525
@time_now_utc = -> { Time.now.utc } # for test time stubbing
2626
end
2727

28-
DEFAULT_UNIQUE_STATES = [
29-
JOB_STATE_AVAILABLE,
30-
JOB_STATE_COMPLETED,
31-
JOB_STATE_RUNNING,
32-
JOB_STATE_RETRYABLE,
33-
JOB_STATE_SCHEDULED
34-
].freeze
35-
private_constant :DEFAULT_UNIQUE_STATES
36-
37-
EMPTY_INSERT_OPTS = InsertOpts.new.freeze
38-
private_constant :EMPTY_INSERT_OPTS
39-
4028
# Inserts a new job for work given a job args implementation and insertion
4129
# options (which may be omitted).
4230
#
@@ -144,6 +132,20 @@ def insert_many(args)
144132
@driver.job_insert_many(all_params)
145133
end
146134

135+
# Default states that are used during a unique insert. Can be overridden by
136+
# setting UniqueOpts#by_state.
137+
DEFAULT_UNIQUE_STATES = [
138+
JOB_STATE_AVAILABLE,
139+
JOB_STATE_COMPLETED,
140+
JOB_STATE_RUNNING,
141+
JOB_STATE_RETRYABLE,
142+
JOB_STATE_SCHEDULED
143+
].freeze
144+
private_constant :DEFAULT_UNIQUE_STATES
145+
146+
EMPTY_INSERT_OPTS = InsertOpts.new.freeze
147+
private_constant :EMPTY_INSERT_OPTS
148+
147149
private def check_unique_job(insert_params, unique_opts, &block)
148150
return block.call if unique_opts.nil?
149151

0 commit comments

Comments
 (0)