diff --git a/Gemfile b/Gemfile index 755bcc4f..947043d2 100644 --- a/Gemfile +++ b/Gemfile @@ -43,7 +43,7 @@ gem 'paypal' gem 'parslet' gem 'pg' gem 'rclconf' -gem 'rmagick' +gem 'rmagick', '4.2.4' gem 'racc' gem 'rack' gem 'rackup' diff --git a/Gemfile.lock b/Gemfile.lock index 55758107..12fa675e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -131,7 +131,6 @@ GEM paypal (2.0.0) money (> 0.0.0) pg (1.4.5) - pkg-config (1.5.5) public_suffix (4.0.7) racc (1.7.1) rack (2.2.6.4) @@ -146,8 +145,7 @@ GEM rclconf (1.0.0) regexp_parser (2.2.0) rexml (3.2.5) - rmagick (5.3.0) - pkg-config (~> 1.4) + rmagick (4.2.4) rspec (3.10.0) rspec-core (~> 3.10.0) rspec-expectations (~> 3.10.0) @@ -322,7 +320,7 @@ DEPENDENCIES rake rbs rclconf - rmagick + rmagick (= 4.2.4) rspec rspec-core rss diff --git a/src/util/job.rb b/src/util/job.rb index 4e356b3c..e1826666 100644 --- a/src/util/job.rb +++ b/src/util/job.rb @@ -69,9 +69,18 @@ def Job.running_job values =[] end if values.length == 3 - keys = [:pid, :basename, :time] - array = [keys, values].transpose.flatten - @running_job = Hash[*array] + pid = values[0] + puts "Found pid #{pid} in job.pid" + if (Process.getpgid(pid.to_i) rescue nil) + process = Process.getpgid(pid.to_i) rescue nil + puts "Job #{process} is running" + keys = [:pid, :basename, :time] + array = [keys, values].transpose.flatten + @running_job = Hash[*array] + else + puts "Job is not running, deleting staled pid file" + File.unlink(PID_FILE) + end end end @running_job