This repository has been archived by the owner on Oct 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #723 from scientist-softserv/i718-separate-fast-la…
…ne-import-queue-and-worker i718 Add auxiliary worker to run different queues
- Loading branch information
Showing
5 changed files
with
214 additions
and
35 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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
AUXILIARY_QUEUE_PRIORITY=100 | ||
CHROME_HOSTNAME=chrome | ||
DATABASE_ADAPTER=postgresql | ||
DATABASE_HOST=db | ||
|
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 |
---|---|---|
@@ -1,8 +1,18 @@ | ||
# frozen_string_literal: true | ||
|
||
class ApplicationJob < ActiveJob::Base | ||
before_enqueue :set_auxiliary_queue_priority | ||
|
||
# limit to 5 attempts | ||
retry_on StandardError, wait: :exponentially_longer, attempts: 5 do |_job, _exception| | ||
# Log error, do nothing, etc. | ||
end | ||
|
||
private | ||
|
||
def set_auxiliary_queue_priority | ||
return unless queue_name.to_sym == :auxiliary | ||
|
||
self.priority = ENV.fetch('AUXILIARY_QUEUE_PRIORITY', 100).to_i | ||
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
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