remove delayed_job, use structure.sql
This commit is contained in:
28
Rakefile
28
Rakefile
@@ -100,34 +100,6 @@ task good_job: %i[environment set_ar_stdout set_logger_stdout] do
|
||||
exec(cmd)
|
||||
end
|
||||
|
||||
task recompute_job_signatures: :environment do
|
||||
ActiveRecord::Base.logger = Logger.new(STDOUT)
|
||||
ActiveRecord::Base.logger.level = :error
|
||||
|
||||
start_at = ENV["start_at"]&.to_i || 0
|
||||
count = 0
|
||||
destroyed = 0
|
||||
puts "# jobs: #{Delayed::Job.count}"
|
||||
Delayed::Job.find_each(start: start_at) do |job|
|
||||
job.set_signature
|
||||
unless job.save
|
||||
job.destroy
|
||||
destroyed += 1
|
||||
end
|
||||
count += 1
|
||||
if count % 50 == 0
|
||||
puts "processed #{count}, destroyed #{destroyed} - last id: #{job.id}"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
task workoff_failed_jobs: %i[environment set_ar_stdout set_logger_stdout] do
|
||||
worker = Delayed::Worker.new
|
||||
Delayed::Job
|
||||
.where("last_error is not null and attempts <= 2")
|
||||
.find_each(batch_size: 1) { |job| worker.run(job) }
|
||||
end
|
||||
|
||||
task :reverse_csv do
|
||||
file = ENV["file"] || raise("need 'file' (file path)")
|
||||
in_csv = CSV.parse(File.open(file, "r+"), headers: true)
|
||||
|
||||
@@ -17,6 +17,8 @@ module ReduxScraper
|
||||
class Application < Rails::Application
|
||||
config.session_store :cookie_store, key: "_refurrer_session"
|
||||
config.assets.precompile << "good_job_custom.css"
|
||||
config.active_record.schema_format = :sql
|
||||
|
||||
# Initialize configuration defaults for originally generated Rails version.
|
||||
config.load_defaults 7.0
|
||||
|
||||
|
||||
5
db/migrate/20250127165909_drop_delayed_jobs.rb
Normal file
5
db/migrate/20250127165909_drop_delayed_jobs.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
class DropDelayedJobs < ActiveRecord::Migration[7.2]
|
||||
def change
|
||||
drop_table :delayed_jobs
|
||||
end
|
||||
end
|
||||
1866
db/schema.rb
generated
1866
db/schema.rb
generated
File diff suppressed because it is too large
Load Diff
7012
db/structure.sql
Normal file
7012
db/structure.sql
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user