Skip to content

Commit

Permalink
Merge branch 'mr_good_job_its_got_to_be_good' into adventist_dev
Browse files Browse the repository at this point in the history
  • Loading branch information
orangewolf committed Sep 22, 2023
2 parents f2fbd2a + 6dae41d commit 6905712
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ PASSENGER_APP_ENV=development
RAILS_LOG_TO_STDOUT=true
REDIS_HOST=redis
SECRET_KEY_BASE=asdf
HYRAX_ACTIVE_JOB_QUEUE=sidekiq
HYRAX_ACTIVE_JOB_QUEUE=good_job
HYRAX_FITS_PATH=/app/fits/fits.sh
NEGATIVE_CAPTCHA_SECRET=default-value-change-me
SOLR_ADMIN_PASSWORD=SolrRocks
Expand Down
20 changes: 20 additions & 0 deletions app/assets/javascripts/admin_color_select.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
$(document).on('turbolinks:load', function() {
$('div.defaultable-colors a.restore-default-color').click(function(e) {
e.preventDefault()

var defaultTarget = $(e.target).data('default-target')
var input = $("input[name='admin_appearance["+ defaultTarget +"]']")

input.val(input.data('default-value'))
})

$('.panel-footer a.restore-all-default-colors').click(function(e) {
e.preventDefault()

var allColorInputs = $("input[name*='color']")

allColorInputs.each(function() {
$(this).val($(this).data('default-value'))
})
})
});
7 changes: 0 additions & 7 deletions config/initializers/good_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,6 @@
# Wrapping this in an after_initialize block to ensure that all constants are loaded
Rails.application.config.after_initialize do
# baseline of 0, higher is sooner

# Commented out the following two jobs because they were
# specfically used for the sdapi ingests.
# see sdapi_ingest_script directory and
# ref: https://github.com/scientist-softserv/adventist-dl/issues/468
# CollectionMembershipJob.priority = 70
# UpdateCollectionMembershipJob.priority = 60
Bulkrax::ScheduleRelationshipsJob.priority = 50
CreateDerivativesJob.priority = 40
CharacterizeJob.priority = 30
Expand Down
4 changes: 2 additions & 2 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# OVERRIDE Hyrax 2.9.0 to add featured collection routes

if ENV.fetch('HYRAX_ACTIVE_JOB_QUEUE', 'sidekiq')
if ENV.fetch('HYRAX_ACTIVE_JOB_QUEUE', 'sidekiq') == 'sidekiq'
require 'sidekiq/web'
end

Expand All @@ -18,7 +18,7 @@
authenticate :user, ->(u) { u.is_superadmin || u.is_admin } do
queue = ENV.fetch('HYRAX_ACTIVE_JOB_QUEUE', 'sidekiq')
case queue
when 'sideki'
when 'sidekiq'
mount Sidekiq::Web => '/jobs'
when 'good_job'
mount GoodJob::Engine => '/jobs'
Expand Down
32 changes: 32 additions & 0 deletions db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
ActiveRecord::Schema.define(version: 2023_08_04_073106) do

# These are extensions that must be enabled in order to support this database
enable_extension "pgcrypto"
enable_extension "plpgsql"

create_table "account_cross_searches", force: :cascade do |t|
Expand Down Expand Up @@ -312,6 +313,37 @@
t.index ["user_id"], name: "index_file_view_stats_on_user_id"
end

create_table "good_job_processes", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.jsonb "state"
end

create_table "good_jobs", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
t.text "queue_name"
t.integer "priority"
t.jsonb "serialized_params"
t.datetime "scheduled_at"
t.datetime "performed_at"
t.datetime "finished_at"
t.text "error"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.uuid "active_job_id"
t.text "concurrency_key"
t.text "cron_key"
t.uuid "retried_good_job_id"
t.datetime "cron_at"
t.index ["active_job_id", "created_at"], name: "index_good_jobs_on_active_job_id_and_created_at"
t.index ["active_job_id"], name: "index_good_jobs_on_active_job_id"
t.index ["concurrency_key"], name: "index_good_jobs_on_concurrency_key_when_unfinished", where: "(finished_at IS NULL)"
t.index ["cron_key", "created_at"], name: "index_good_jobs_on_cron_key_and_created_at"
t.index ["cron_key", "cron_at"], name: "index_good_jobs_on_cron_key_and_cron_at", unique: true
t.index ["finished_at"], name: "index_good_jobs_jobs_on_finished_at", where: "((retried_good_job_id IS NULL) AND (finished_at IS NOT NULL))"
t.index ["queue_name", "scheduled_at"], name: "index_good_jobs_on_queue_name_and_scheduled_at", where: "(finished_at IS NULL)"
t.index ["scheduled_at"], name: "index_good_jobs_on_scheduled_at", where: "(finished_at IS NULL)"
end

create_table "group_roles", force: :cascade do |t|
t.bigint "role_id"
t.bigint "group_id"
Expand Down

0 comments on commit 6905712

Please sign in to comment.