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