Skip to content

Commit 7d36912

Browse files
committed
Cleans up edited files to project standard formatting
1 parent c817349 commit 7d36912

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

app/models/solid_queue/semaphore.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,11 @@ def attempt_creation
6666
def check_limit_or_decrement = limit == 1 ? false : attempt_decrement
6767

6868
def attempt_decrement
69-
Semaphore.available.where(key: key).update_all(["value = value - 1, expires_at = ?", expires_at]) > 0
69+
Semaphore.available.where(key: key).update_all([ "value = value - 1, expires_at = ?", expires_at ]) > 0
7070
end
7171

7272
def attempt_increment
73-
Semaphore.where(key: key, value: ...limit).update_all(["value = value + 1, expires_at = ?", expires_at]) > 0
73+
Semaphore.where(key: key, value: ...limit).update_all([ "value = value + 1, expires_at = ?", expires_at ]) > 0
7474
end
7575

7676
def key

test/integration/concurrency_controls_test.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ class ConcurrencyControlsTest < ActiveSupport::TestCase
8383

8484
# C would have started in the beginning, seeing the status empty, and would finish after
8585
# all other jobs, so it'll do the last update with only itself
86-
assert_stored_sequence(@result, ["C"])
86+
assert_stored_sequence(@result, [ "C" ])
8787
end
8888

8989
test "run several jobs over the same record sequentially, with some of them failing" do
@@ -99,7 +99,7 @@ class ConcurrencyControlsTest < ActiveSupport::TestCase
9999
wait_for_jobs_to_finish_for(3.seconds)
100100
assert_equal 3, SolidQueue::FailedExecution.count
101101

102-
assert_stored_sequence @result, ["B", "D", "F"] + ("G".."K").to_a
102+
assert_stored_sequence @result, [ "B", "D", "F" ] + ("G".."K").to_a
103103
end
104104

105105
test "rely on dispatcher to unblock blocked executions with an available semaphore" do
@@ -133,7 +133,7 @@ class ConcurrencyControlsTest < ActiveSupport::TestCase
133133

134134
# We can't ensure the order between B and C, because it depends on which worker wins when
135135
# unblocking, as one will try to unblock B and another C
136-
assert_stored_sequence @result, ("A".."K").to_a, ["A", "C", "B"] + ("D".."K").to_a
136+
assert_stored_sequence @result, ("A".."K").to_a, [ "A", "C", "B" ] + ("D".."K").to_a
137137
end
138138

139139
test "rely on dispatcher to unblock blocked executions with an expired semaphore" do
@@ -165,7 +165,7 @@ class ConcurrencyControlsTest < ActiveSupport::TestCase
165165

166166
# We can't ensure the order between B and C, because it depends on which worker wins when
167167
# unblocking, as one will try to unblock B and another C
168-
assert_stored_sequence @result, ("A".."K").to_a, ["A", "C", "B"] + ("D".."K").to_a
168+
assert_stored_sequence @result, ("A".."K").to_a, [ "A", "C", "B" ] + ("D".."K").to_a
169169
end
170170

171171
test "don't block claimed executions that get released" do

0 commit comments

Comments
 (0)