Module: MailEngine::RakeLocker

Defined in:
lib/mail_engine/rake_locker.rb

Constant Summary collapse

TRY_TIMES =
4

Instance Method Summary collapse

Instance Method Details

#lock_taskObject



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

def lock_task
  raise "Please pass block." unless block_given?

  if locked?
    puts 'locked!'
    lock
  else
    lock
    yield
    unlock
  end
end