Commit 9cd500ab75aa740c19fc8d90d2ca2cc8fb65a331

Check if the tasklock file exists before to load rails environment

Commit diff

script/task_performer

 
11#!/usr/bin/env ruby
22
3ENV["RAILS_ENV"] ||= "production"
4require File.dirname(__FILE__) + "/../config/environment"
3require 'tmpdir'
54require "fileutils"
65
7LOCK_FILE_PATH = File.join(RAILS_ROOT, "tmp", "task_lockfile")
8
6LOCK_FILE_PATH = File.join(Dir.tmpdir, "gitorious_task_lockfile")
97ENV["PATH"] = "/usr/local/bin/:/opt/local/bin:#{ENV["PATH"]}"
108
9if File.exist?(LOCK_FILE_PATH)
10 $stderr.puts "Task lockfile '#{LOCK_FILE_PATH}' exists!"
11 exit(1)
12end
13
14ENV["RAILS_ENV"] ||= "production"
15require File.dirname(__FILE__) + "/../config/environment"
16
17
1118class TaskLockError < StandardError; end
1219
1320def with_lock(&block)
toggle raw diff