feat: new background work process

This removes all previous dependencies on RabbitMQ and the need to run separate cron and requeueing processes.
This commit is contained in:
Adam Cooke
2024-02-23 22:51:33 +00:00
committed by Adam Cooke
parent 044058d0f1
commit dc8e895bfe
69 changed files with 1675 additions and 1186 deletions
+40
View File
@@ -0,0 +1,40 @@
# frozen_string_literal: true
# == Schema Information
#
# Table name: queued_messages
#
# id :integer not null, primary key
# attempts :integer default(0)
# batch_key :string(255)
# domain :string(255)
# locked_at :datetime
# locked_by :string(255)
# manual :boolean default(FALSE)
# retry_after :datetime
# created_at :datetime
# updated_at :datetime
# ip_address_id :integer
# message_id :integer
# route_id :integer
# server_id :integer
#
# Indexes
#
# index_queued_messages_on_domain (domain)
# index_queued_messages_on_message_id (message_id)
# index_queued_messages_on_server_id (server_id)
#
FactoryBot.define do
factory :queued_message do
server
message_id { 1234 }
domain { "example.com" }
batch_key { nil }
trait :locked do
locked_by { "worker1" }
locked_at { 5.minutes.ago }
end
end
end