مراية لـ
https://github.com/postalserver/postal.git
تم المزامنة 2025-11-30 21:32:30 +00:00
feat: new background work process
This removes all previous dependencies on RabbitMQ and the need to run separate cron and requeueing processes.
هذا الالتزام موجود في:
14
db/migrate/20240213165450_create_worker_roles.rb
Normal file
14
db/migrate/20240213165450_create_worker_roles.rb
Normal file
@@ -0,0 +1,14 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class CreateWorkerRoles < ActiveRecord::Migration[6.1]
|
||||
|
||||
def change
|
||||
create_table :worker_roles do |t|
|
||||
t.string :role
|
||||
t.string :worker
|
||||
t.datetime :acquired_at
|
||||
t.index :role, unique: true
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
13
db/migrate/20240213171830_create_scheduled_tasks.rb
Normal file
13
db/migrate/20240213171830_create_scheduled_tasks.rb
Normal file
@@ -0,0 +1,13 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class CreateScheduledTasks < ActiveRecord::Migration[6.1]
|
||||
|
||||
def change
|
||||
create_table :scheduled_tasks do |t|
|
||||
t.string :name
|
||||
t.datetime :next_run_after
|
||||
t.index :name, unique: true
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
@@ -0,0 +1,12 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class AddLockFieldsToWebhookRequests < ActiveRecord::Migration[6.1]
|
||||
|
||||
def change
|
||||
add_column :webhook_requests, :locked_by, :string
|
||||
add_column :webhook_requests, :locked_at, :datetime
|
||||
|
||||
add_index :webhook_requests, :locked_by
|
||||
end
|
||||
|
||||
end
|
||||
18
db/schema.rb
18
db/schema.rb
@@ -10,7 +10,7 @@
|
||||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(version: 2024_02_06_173036) do
|
||||
ActiveRecord::Schema.define(version: 2024_02_14_132253) do
|
||||
|
||||
create_table "additional_route_endpoints", id: :integer, charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
||||
t.integer "route_id"
|
||||
@@ -213,6 +213,12 @@ ActiveRecord::Schema.define(version: 2024_02_06_173036) do
|
||||
t.index ["token"], name: "index_routes_on_token", length: 6
|
||||
end
|
||||
|
||||
create_table "scheduled_tasks", charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
||||
t.string "name"
|
||||
t.datetime "next_run_after"
|
||||
t.index ["name"], name: "index_scheduled_tasks_on_name", unique: true
|
||||
end
|
||||
|
||||
create_table "servers", id: :integer, charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
||||
t.integer "organization_id"
|
||||
t.string "uuid"
|
||||
@@ -343,6 +349,9 @@ ActiveRecord::Schema.define(version: 2024_02_06_173036) do
|
||||
t.datetime "retry_after", precision: 6
|
||||
t.text "error"
|
||||
t.datetime "created_at", precision: 6
|
||||
t.string "locked_by"
|
||||
t.datetime "locked_at"
|
||||
t.index ["locked_by"], name: "index_webhook_requests_on_locked_by"
|
||||
end
|
||||
|
||||
create_table "webhooks", id: :integer, charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
||||
@@ -359,4 +368,11 @@ ActiveRecord::Schema.define(version: 2024_02_06_173036) do
|
||||
t.index ["server_id"], name: "index_webhooks_on_server_id"
|
||||
end
|
||||
|
||||
create_table "worker_roles", charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
||||
t.string "role"
|
||||
t.string "worker"
|
||||
t.datetime "acquired_at"
|
||||
t.index ["role"], name: "index_worker_roles_on_role", unique: true
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
المرجع في مشكلة جديدة
حظر مستخدم