Skip to content

Commit 43f6834

Browse files
set default to 15 seconds
1 parent ae7b44f commit 43f6834

File tree

2 files changed

+1
-7
lines changed

2 files changed

+1
-7
lines changed

lib/closure_tree/support.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def initialize(model_class, options)
2323
:dependent => :nullify, # or :destroy or :delete_all -- see the README
2424
:name_column => 'name',
2525
:with_advisory_lock => true,
26-
:advisory_lock_timeout_seconds => 5,
26+
:advisory_lock_timeout_seconds => 15,
2727
:numeric_order => false
2828
}.merge(options)
2929
raise ArgumentError, "name_column can't be 'path'" if options[:name_column] == 'path'

spec/closure_tree/parallel_spec.rb

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,12 +121,6 @@ def work
121121
end
122122

123123
it 'fails to deadlock while simultaneously deleting items from the same hierarchy' do
124-
allow(User).to receive(:with_advisory_lock!).and_wrap_original do |method, *args, &block|
125-
options = args.extract_options!
126-
options[:timeout_seconds] = 15
127-
method.call(*args, options, &block)
128-
end
129-
130124
target = User.find_or_create_by_path((1..200).to_a.map { |ea| ea.to_s })
131125
emails = target.self_and_ancestors.to_a.map(&:email).shuffle
132126
Parallel.map(emails, :in_threads => max_threads) do |email|

0 commit comments

Comments
 (0)