Compare commits
13
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
04c7349499 | ||
|
|
85a987400f | ||
|
|
dd25751a19 | ||
|
|
07c920f693 | ||
|
|
1c10d97c76 | ||
|
|
66d013c0d4 | ||
|
|
9ac6b86e42 | ||
|
|
cc71a86651 | ||
|
|
39cec8b42d | ||
|
|
5de4341222 | ||
|
|
b7cedb673e | ||
|
|
926aa8559d | ||
|
|
d16486ffdc |
@@ -1,3 +1,4 @@
|
|||||||
release: POSTGRES_STATEMENT_TIMEOUT=600s bundle exec rails db:chatwoot_prepare && echo $SOURCE_VERSION > .git_sha
|
release: POSTGRES_STATEMENT_TIMEOUT=600s bundle exec rails db:chatwoot_prepare && echo $SOURCE_VERSION > .git_sha
|
||||||
web: bundle exec rails ip_lookup:setup && bin/rails server -p $PORT -e $RAILS_ENV
|
web: bundle exec rails ip_lookup:setup && bin/rails server -p $PORT -e $RAILS_ENV
|
||||||
worker: bundle exec rails ip_lookup:setup && bundle exec sidekiq -C config/sidekiq.yml
|
default_worker: bundle exec rails ip_lookup:setup && bundle exec sidekiq -C config/sidekiq/default.yml
|
||||||
|
quarantine_worker: bundle exec rails ip_lookup:setup && bundle exec sidekiq -C config/sidekiq/quarantine.yml
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
class Inboxes::FetchImapEmailInboxesJob < ApplicationJob
|
class Inboxes::FetchImapEmailInboxesJob < ApplicationJob
|
||||||
queue_as :scheduled_jobs
|
queue_as :one_min_mailer
|
||||||
|
|
||||||
def perform
|
def perform
|
||||||
Inbox.where(channel_type: 'Channel::Email').all.find_each(batch_size: 100) do |inbox|
|
Inbox.where(channel_type: 'Channel::Email').all.find_each(batch_size: 100) do |inbox|
|
||||||
|
|||||||
+1
-1
@@ -18,7 +18,7 @@ trigger_scheduled_items_job:
|
|||||||
trigger_imap_email_inboxes_job:
|
trigger_imap_email_inboxes_job:
|
||||||
cron: '*/1 * * * *'
|
cron: '*/1 * * * *'
|
||||||
class: 'Inboxes::FetchImapEmailInboxesJob'
|
class: 'Inboxes::FetchImapEmailInboxesJob'
|
||||||
queue: scheduled_jobs
|
queue: one_min_mailer
|
||||||
|
|
||||||
# executed daily at 2230 UTC
|
# executed daily at 2230 UTC
|
||||||
# which is our lowest traffic time
|
# which is our lowest traffic time
|
||||||
|
|||||||
@@ -0,0 +1,29 @@
|
|||||||
|
# Sample configuration file for Sidekiq.
|
||||||
|
# Options here can still be overridden by cmd line args.
|
||||||
|
# Place this file at config/sidekiq.yml and Sidekiq will
|
||||||
|
# pick it up automatically.
|
||||||
|
---
|
||||||
|
:verbose: false
|
||||||
|
:concurrency: <%= ENV.fetch("SIDEKIQ_CONCURRENCY", 10) %>
|
||||||
|
:timeout: 25
|
||||||
|
:max_retries: 3
|
||||||
|
|
||||||
|
# Sidekiq will run this file through ERB when reading it so you can
|
||||||
|
# even put in dynamic logic, like a host-specific queue.
|
||||||
|
# http://www.mikeperham.com/2013/11/13/advanced-sidekiq-host-specific-queues/
|
||||||
|
# https://github.com/sidekiq/sidekiq/wiki/Advanced-Options
|
||||||
|
# Since queues are declared without waits, the jobs in lower ranking queues will only be processed
|
||||||
|
# if there are no jobs in higher ranking queues.
|
||||||
|
:queues:
|
||||||
|
- critical
|
||||||
|
- high
|
||||||
|
- medium
|
||||||
|
- default
|
||||||
|
- mailers
|
||||||
|
- action_mailbox_routing
|
||||||
|
- low
|
||||||
|
- one_min_mailer
|
||||||
|
- async_database_migration
|
||||||
|
- active_storage_analysis
|
||||||
|
- active_storage_purge
|
||||||
|
- action_mailbox_incineration
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
# Sample configuration file for Sidekiq.
|
||||||
|
# Options here can still be overridden by cmd line args.
|
||||||
|
# Place this file at config/sidekiq.yml and Sidekiq will
|
||||||
|
# pick it up automatically.
|
||||||
|
---
|
||||||
|
:verbose: false
|
||||||
|
:concurrency: <%= ENV.fetch("SIDEKIQ_CONCURRENCY", 10) %>
|
||||||
|
:timeout: 25
|
||||||
|
:max_retries: 3
|
||||||
|
|
||||||
|
# Sidekiq will run this file through ERB when reading it so you can
|
||||||
|
# even put in dynamic logic, like a host-specific queue.
|
||||||
|
# http://www.mikeperham.com/2013/11/13/advanced-sidekiq-host-specific-queues/
|
||||||
|
# https://github.com/sidekiq/sidekiq/wiki/Advanced-Options
|
||||||
|
# Since queues are declared without waits, the jobs in lower ranking queues will only be processed
|
||||||
|
# if there are no jobs in higher ranking queues.
|
||||||
|
:queues:
|
||||||
|
- scheduled_jobs
|
||||||
@@ -10,7 +10,7 @@ RSpec.describe Inboxes::FetchImapEmailInboxesJob do
|
|||||||
|
|
||||||
it 'enqueues the job' do
|
it 'enqueues the job' do
|
||||||
expect { described_class.perform_later }.to have_enqueued_job(described_class)
|
expect { described_class.perform_later }.to have_enqueued_job(described_class)
|
||||||
.on_queue('scheduled_jobs')
|
.on_queue('one_min_mailer')
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'when called' do
|
context 'when called' do
|
||||||
|
|||||||
Reference in New Issue
Block a user