Module: Ferret::Index::SynchroLockMixin

Defined in:
lib/ferret/index.rb

Instance Method Summary collapse

Instance Method Details

#synchrolockObject



5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/ferret/index.rb', line 5

def synchrolock
  trys = 5
  begin
    synchronize {yield}
  rescue Ferret::Store::Lock::LockError => e
    if (trys -= 1) <= 0
      raise e
    else
      retry
    end
  end
end