lib/lambda_punch/notifier.rb in lambda_punch-1.0.0 vs lib/lambda_punch/notifier.rb in lambda_punch-1.0.1
- old
+ new
@@ -1,10 +1,9 @@
module LambdaPunch
class Notifier
FILE = "#{Dir.tmpdir}/lambdapunch-handled"
- File.open(FILE, 'w') { |f| f.write('') }
class << self
def handled!(context)
File.open(FILE, 'w') do |f|
@@ -18,9 +17,10 @@
end
def initialize
@notifier = INotify::Notifier.new
+ File.open(FILE, 'w') { |f| f.write('') } unless File.exist?(FILE)
end
def watch
@notifier.watch(FILE, :modify, :oneshot) { yield(request_id) }
end