Sha256: 5f5a369504119a07a3e0c6a8a3738ca9948375d1a553bff8b1a16b3605ef3e33

Contents?: true

Size: 628 Bytes

Versions: 23

Compression:

Stored size: 628 Bytes

Contents

#!/usr/bin/env ruby
# frozen_string_literal: true

require 'rubygems'
require 'daemons'
require 'fileutils'

def find_rails_root(dir = Dir.pwd)
  raise 'Rails root not found' if ['', '/', '.'].include?(dir)
  return dir if File.exist?(File.expand_path('config/environment.rb', dir))

  rails_root(File.dirname(dir))
end

rails_root = find_rails_root
dir = File.expand_path('tmp/pids', rails_root)
FileUtils.mkdir_p(dir)
Daemons.run_proc 'tasks_scheduler', dir_mode: :normal, dir: dir do
  ::Dir.chdir(rails_root) do
    require File.join(rails_root, 'config', 'environment')
    ::TasksScheduler::Checker.instance.run
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
tasks_scheduler-0.7.0 exe/tasks_scheduler
tasks_scheduler-0.6.13 exe/tasks_scheduler
tasks_scheduler-0.6.12 exe/tasks_scheduler
tasks_scheduler-0.6.11 exe/tasks_scheduler
tasks_scheduler-0.6.10 exe/tasks_scheduler
tasks_scheduler-0.6.9 exe/tasks_scheduler
tasks_scheduler-0.6.8 exe/tasks_scheduler
tasks_scheduler-0.6.7 exe/tasks_scheduler
tasks_scheduler-0.6.6 exe/tasks_scheduler
tasks_scheduler-0.6.5 exe/tasks_scheduler
tasks_scheduler-0.6.4 exe/tasks_scheduler
tasks_scheduler-0.6.3 exe/tasks_scheduler
tasks_scheduler-0.6.2 exe/tasks_scheduler
tasks_scheduler-0.6.1 exe/tasks_scheduler
tasks_scheduler-0.6.0 exe/tasks_scheduler
tasks_scheduler-0.5.4 exe/tasks_scheduler
tasks_scheduler-0.5.3 exe/tasks_scheduler
tasks_scheduler-0.5.2 exe/tasks_scheduler
tasks_scheduler-0.5.1 exe/tasks_scheduler
tasks_scheduler-0.5.0 exe/tasks_scheduler