chore: rubocop

chore: fix api test conventions

chore: rubocop -A spec/

chore: more rubocop -A

fix failing test

rubocop fixes

removes helper methods that are in my opinion dead code

more rubocop fixes

rubocop -a --auto-gen-config
This commit is contained in:
Philipp Rothmann 2023-05-12 13:01:12 +02:00 committed by Philipp Rothmann
parent f6fb804bbe
commit fb2b4d8a8a
331 changed files with 4263 additions and 4507 deletions

View file

@ -1,32 +1,32 @@
require "resque/tasks"
require 'resque/tasks'
def run_worker(queue, count = 1)
puts "Starting #{count} worker(s) with QUEUE: #{queue}"
ops = { :pgroup => true, :err => ["log/resque_worker_foodsoft_notifier.log", "a"],
:out => ["log/resque_worker_foodsoft_notifier.log", "a"] }
env_vars = { "QUEUE" => queue.to_s, "PIDFILE" => "tmp/pids/resque_worker_foodsoft_notifier.pid" }
count.times {
ops = { pgroup: true, err: ['log/resque_worker_foodsoft_notifier.log', 'a'],
out: ['log/resque_worker_foodsoft_notifier.log', 'a'] }
env_vars = { 'QUEUE' => queue.to_s, 'PIDFILE' => 'tmp/pids/resque_worker_foodsoft_notifier.pid' }
count.times do
## Using Kernel.spawn and Process.detach because regular system() call would
## cause the processes to quit when capistrano finishes
pid = spawn(env_vars, "bundle exec rake resque:work", ops)
pid = spawn(env_vars, 'bundle exec rake resque:work', ops)
Process.detach(pid)
}
end
end
namespace :resque do
task :setup => :environment
task setup: :environment
desc "Restart running workers"
desc 'Restart running workers'
task :restart_workers do
Rake::Task['resque:stop_workers'].invoke
Rake::Task['resque:start_workers'].invoke
end
desc "Quit running workers"
desc 'Quit running workers'
task :stop_workers do
pids = File.read('tmp/pids/resque_worker_foodsoft_notifier.pid').split("\n")
if pids.empty?
puts "No workers to kill"
puts 'No workers to kill'
else
syscmd = "kill -s QUIT #{pids.join(' ')}"
puts "Running syscmd: #{syscmd}"
@ -34,8 +34,8 @@ namespace :resque do
end
end
desc "Start workers"
desc 'Start workers'
task :start_workers do
run_worker("foodsoft_notifier")
run_worker('foodsoft_notifier')
end
end