Method: Spring::Server#write_pidfile
- Defined in:
- lib/spring/server.rb
#write_pidfile ⇒ Object
124 125 126 127 128 129 130 131 132 |
# File 'lib/spring/server.rb', line 124 def write_pidfile if @pidfile.flock(File::LOCK_EX | File::LOCK_NB) @pidfile.truncate(0) @pidfile.write("#{Process.pid}\n") @pidfile.fsync else exit 1 end end |