-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e907f1a
commit 42d043b
Showing
9 changed files
with
119 additions
and
6 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/usr/bin/env ruby | ||
|
||
require_relative "../config/environment" | ||
require "solid_queue/cli" | ||
|
||
SolidQueue::Cli.start(ARGV) |
This file contains 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 file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# production: | ||
# periodic_cleanup: | ||
# class: CleanSoftDeletedRecordsJob | ||
# queue: background | ||
# args: [ 1000, { batch_size: 500 } ] | ||
# schedule: every hour | ||
# periodic_command: | ||
# command: "SoftDeletedRecord.due.delete_all" | ||
# priority: 2 | ||
# schedule: at 5am every day |
15 changes: 15 additions & 0 deletions
15
db/migrate/20241016075104_create_recurring_executions.solid_queue.rb
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# This migration comes from solid_queue (originally 20240218110712) | ||
class CreateRecurringExecutions < ActiveRecord::Migration[7.1] | ||
def change | ||
create_table :solid_queue_recurring_executions do |t| | ||
t.references :job, index: { unique: true }, null: false | ||
t.string :task_key, null: false | ||
t.datetime :run_at, null: false | ||
t.datetime :created_at, null: false | ||
|
||
t.index [ :task_key, :run_at ], unique: true | ||
end | ||
|
||
add_foreign_key :solid_queue_recurring_executions, :solid_queue_jobs, column: :job_id, on_delete: :cascade | ||
end | ||
end |
21 changes: 21 additions & 0 deletions
21
db/migrate/20241016075105_create_recurring_tasks.solid_queue.rb
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# This migration comes from solid_queue (originally 20240719134516) | ||
class CreateRecurringTasks < ActiveRecord::Migration[7.1] | ||
def change | ||
create_table :solid_queue_recurring_tasks do |t| | ||
t.string :key, null: false, index: { unique: true } | ||
t.string :schedule, null: false | ||
t.string :command, limit: 2048 | ||
t.string :class_name | ||
t.text :arguments | ||
|
||
t.string :queue_name | ||
t.integer :priority, default: 0 | ||
|
||
t.boolean :static, default: true, index: true | ||
|
||
t.text :description | ||
|
||
t.timestamps | ||
end | ||
end | ||
end |
6 changes: 6 additions & 0 deletions
6
db/migrate/20241016075106_add_name_to_processes.solid_queue.rb
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# This migration comes from solid_queue (originally 20240811173327) | ||
class AddNameToProcesses < ActiveRecord::Migration[7.1] | ||
def change | ||
add_column :solid_queue_processes, :name, :string | ||
end | ||
end |
17 changes: 17 additions & 0 deletions
17
db/migrate/20241016075107_make_name_not_null.solid_queue.rb
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# This migration comes from solid_queue (originally 20240813160053) | ||
class MakeNameNotNull < ActiveRecord::Migration[7.1] | ||
def up | ||
SolidQueue::Process.where(name: nil).find_each do |process| | ||
process.name ||= [ process.kind.downcase, SecureRandom.hex(10) ].join("-") | ||
process.save! | ||
end | ||
|
||
change_column :solid_queue_processes, :name, :string, null: false | ||
add_index :solid_queue_processes, [ :name, :supervisor_id ], unique: true | ||
end | ||
|
||
def down | ||
remove_index :solid_queue_processes, [ :name, :supervisor_id ] | ||
change_column :solid_queue_processes, :name, :string, null: false | ||
end | ||
end |
6 changes: 6 additions & 0 deletions
6
...grate/20241016075108_change_solid_queue_recurring_tasks_static_to_not_null.solid_queue.rb
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# This migration comes from solid_queue (originally 20240819165045) | ||
class ChangeSolidQueueRecurringTasksStaticToNotNull < ActiveRecord::Migration[7.1] | ||
def change | ||
change_column_null :solid_queue_recurring_tasks, :static, false, true | ||
end | ||
end |
This file contains 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