lib/hayabusa_fcgi.rb in hayabusa-0.0.15 vs lib/hayabusa_fcgi.rb in hayabusa-0.0.16
- old
+ new
@@ -42,10 +42,10 @@
FileUtils.touch(fcgi_config_fp) if !File.exists?(fcgi_config_fp)
File.open(fcgi_config_fp) do |fp|
fp.flock(File::LOCK_EX)
- fcgi_config_cont = File.read(fcgi_config_fp)
+ fcgi_config_cont = File.read(fcgi_config_fp) rescue ""
if !fcgi_config_cont.empty?
#Seems like an instance is already running - check PID to be sure.
fcgi_config = Marshal.load(File.read(fcgi_config_fp))
pid = fcgi_config[:pid]