@@ -149,7 +149,7 @@ def insert_many(args)
149149 private def check_unique_job ( insert_params , unique_opts , &block )
150150 return block . call if unique_opts . nil?
151151
152- any_changes = false
152+ any_unique_opts = false
153153 get_params = Driver ::JobGetByKindAndUniquePropertiesParam . new ( kind : insert_params . kind )
154154
155155 # It's extremely important here that this lock string format and algorithm
@@ -159,35 +159,35 @@ def insert_many(args)
159159 lock_str += "kind=#{ insert_params . kind } "
160160
161161 if unique_opts . by_args
162- any_changes = true
162+ any_unique_opts = true
163163 get_params . encoded_args = insert_params . encoded_args
164164 lock_str += "&args=#{ insert_params . encoded_args } "
165165 end
166166
167167 if unique_opts . by_period
168168 lower_period_bound = truncate_time ( @time_now_utc . call , unique_opts . by_period ) . utc
169169
170- any_changes = true
170+ any_unique_opts = true
171171 get_params . created_at = [ lower_period_bound , lower_period_bound + unique_opts . by_period ]
172172 lock_str += "&period=#{ lower_period_bound . strftime ( "%FT%TZ" ) } "
173173 end
174174
175175 if unique_opts . by_queue
176- any_changes = true
176+ any_unique_opts = true
177177 get_params . queue = insert_params . queue
178178 lock_str += "&queue=#{ insert_params . queue } "
179179 end
180180
181181 if unique_opts . by_state
182- any_changes = true
182+ any_unique_opts = true
183183 get_params . state = unique_opts . by_state
184184 lock_str += "&state=#{ unique_opts . by_state . join ( "," ) } "
185185 else
186186 get_params . state = DEFAULT_UNIQUE_STATES
187187 lock_str += "&state=#{ DEFAULT_UNIQUE_STATES . join ( "," ) } "
188188 end
189189
190- return block . call unless any_changes
190+ return block . call unless any_unique_opts
191191
192192 @driver . transaction do
193193 lock_key = if @advisory_lock_prefix . nil?
0 commit comments