src/synchronizer.rb
#Returns true if there is currently a sync going on
Returns true if there is currently a sync going on
Returns true if there is currently a sync going on
def check_lock
    if File.file? LOCK_PATH
      pid = File.read LOCK_PATH
      begin
        Process.kill(0, pid.to_i)
        Log.log_message "There is already a sync in progress! - PID : #{pid}"
        return true
      rescue Errno::ESRCH => e
        delete_lock
        return false
      end
    else
      false
    end
  end
def check_lock if File . file? LOCK_PATH pid = File . read LOCK_PATH begin Process . kill ( 0 , pid . to_i ) Log . log_message "There is already a sync in progress! - PID : #{pid}" return true rescue Errno :: ESRCH => e delete_lock return false end else false end end
Returns true if there is currently a sync going on
Returns true if there is currently a sync going on
#Check if process actually exists or if lock was left accidentally