This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This method reads all models that the project hash. | |
# @return [Array] The proyect models list. | |
def self.load_models | |
models = [] #All models will be in this list. | |
models_valids = [] #This list is only to models with database table associated. | |
mod = nil | |
#Get all models in Model's folder | |
Dir["#{RAILS_ROOT}/app/models/**/*.rb"].each do |file| |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace :check_services do | |
task :sidekiq => :environment do | |
path = "path/to/file.pid" | |
pid=File.open(path,'r').read.gsub("\n",'') | |
result = IO.popen("ps aux | grep sidekiq").gets.include?(pid) | |
unless result | |
system "command_to_run_your_sidekiq" # For Example: bundle exec sidekiq -C config/sidekiq.yml | |
end | |
end | |
end |