Skip to content

Latest commit

 

History

History
18 lines (12 loc) · 267 Bytes

single-instance-running.md

File metadata and controls

18 lines (12 loc) · 267 Bytes

Single instance running

DATA.flock(File::LOCK_EX | File::LOCK_NB) or abort 'Already running'

trap('INT', 'EXIT')
puts 'Running...'
loop do
  sleep
end

__END__
DO NOT DELETE: used for locking

View Source