Skip to content

Commit

Permalink
Add explicit requires for riiif constants
Browse files Browse the repository at this point in the history
In development we were seeing the Universal Viewer locking up the entire
web service when trying to load certain riiif constants.  This commit
will load those contants beforehand in an initializer.
  • Loading branch information
kirkkwang committed Jul 4, 2024
1 parent daa09a0 commit e890b9f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions config/initializers/riiif.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
# frozen_string_literal: true

# Loading these constants during runtime would freeze the web service in development.
# Adding the requires here to load them on initialize.
require 'riiif/imagemagick_transformer'
require 'riiif/imagemagick_command_factory'
require 'riiif/crop'
require 'riiif/resize'

Rails.application.reloader.to_prepare do
Riiif::Image.info_service = lambda do |id, _file|
# id will look like a path to a pcdm:file
Expand Down

0 comments on commit e890b9f

Please sign in to comment.