Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove delayed job #480

Merged
merged 1 commit into from
Oct 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@ gem 'active_model_serializers', '~> 0.10'
# Use ActiveModel has_secure_password
gem 'bcrypt', '~> 3.1'

gem 'delayed_job_active_record', '~> 4.1'

gem 'delayed_cron_job', '~> 0.9'

# Use GoodJob as our Active Job queue adapter
gem 'good_job', '~> 3.18'

Expand Down
9 changes: 0 additions & 9 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,6 @@ GEM
debug (1.8.0)
irb (>= 1.5.0)
reline (>= 0.3.1)
delayed_cron_job (0.9.0)
fugit (>= 1.5)
delayed_job (4.1.11)
activesupport (>= 3.0, < 8.0)
delayed_job_active_record (4.1.7)
activerecord (>= 3.0, < 8.0)
delayed_job (>= 3.0, < 5)
docile (1.4.0)
erubi (1.12.0)
et-orbi (1.2.7)
Expand Down Expand Up @@ -273,8 +266,6 @@ DEPENDENCIES
bootsnap (~> 1.16.0)
codecov (~> 0.6.0)
debug (~> 1.8)
delayed_cron_job (~> 0.9)
delayed_job_active_record (~> 4.1)
factory_bot_rails (~> 6.2)
faker (~> 3.2)
good_job (~> 3.18)
Expand Down
5 changes: 0 additions & 5 deletions bin/delayed_job

This file was deleted.

16 changes: 0 additions & 16 deletions config/initializers/delayed_job.rb

This file was deleted.

24 changes: 24 additions & 0 deletions db/migrate/20230910071837_drop_delayed_jobs_table.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
class DropDelayedJobsTable < ActiveRecord::Migration[7.0]
def up
drop_table :delayed_jobs
end

def down
create_table :delayed_jobs, force: true do |table|
table.integer :priority, default: 0, null: false # Allows some jobs to jump to the front of the queue
table.integer :attempts, default: 0, null: false # Provides for retries, but still fail eventually.
table.text :handler, null: false # YAML-encoded string of the object that will do work
table.text :last_error # reason for last failure (See Note below)
table.datetime :run_at # When to run. Could be Time.zone.now for immediately, or sometime in the future.
table.datetime :locked_at # Set when a client is working on this object
table.datetime :failed_at # Set when all retries have failed (actually, by default, the record is deleted instead)
table.string :locked_by # Who is working on this object (if locked)
table.string :queue # The name of the queue this job is in
table.timestamps null: true

table.string :cron
end

add_index :delayed_jobs, [:priority, :run_at], name: "delayed_jobs_priority"
end
end
18 changes: 1 addition & 17 deletions db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema[7.0].define(version: 2023_09_09_125247) do
ActiveRecord::Schema[7.0].define(version: 2023_09_10_071837) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"

Expand Down Expand Up @@ -139,22 +139,6 @@
t.index ["filename"], name: "index_cover_filenames_on_filename", unique: true
end

create_table "delayed_jobs", force: :cascade do |t|
t.integer "priority", default: 0, null: false
t.integer "attempts", default: 0, null: false
t.text "handler", null: false
t.text "last_error"
t.datetime "run_at", precision: nil
t.datetime "locked_at", precision: nil
t.datetime "failed_at", precision: nil
t.string "locked_by"
t.string "queue"
t.datetime "created_at", precision: nil
t.datetime "updated_at", precision: nil
t.string "cron"
t.index ["priority", "run_at"], name: "delayed_jobs_priority"
end

create_table "genres", force: :cascade do |t|
t.string "name", null: false
t.string "normalized_name", null: false
Expand Down
33 changes: 0 additions & 33 deletions gemset.nix

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.