Skip to content

Commit

Permalink
try hyrax logger
Browse files Browse the repository at this point in the history
  • Loading branch information
jwellnit committed Jan 27, 2025
1 parent df07e0e commit 077b9a9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions app/services/spot/derivatives/video_derivative_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ def check_premade_derivatives(filename)
base_file = filename.to_s.split('/')[-1].split('.')[0]
project_name = base_file.split('_')[0]
prefix = project_name + "/" + base_file + "_derivative"
Sidekiq.logger.warn('Derivative Prefix: ' + prefix)
Hyrax.logger.warn('Derivative Prefix: ' + prefix)
object_list = s3_client.list_objects(bucket: s3_source, prefix: prefix).to_h[:contents]

return false if object_list.nil?

Sidekiq::Logging.logger.warn { 'Derivative list size: ' + object_list.length.to_s }
Hyrax.logger.warn('Derivative list size: ' + object_list.length.to_s)

premade_derivatives = []
object_list.each do |object|
Expand Down Expand Up @@ -82,15 +82,15 @@ def check_transcript(filename)
base_file = filename.to_s.split('/')[-1].split('.')[0]
project_name = base_file.split('_')[0]
transcript_name = project_name + "/" + base_file + "_caption.vtt"
Sidekiq::Logging.logger.warn { 'Transcript Name: ' + transcript_name }
Hyrax.logger.warn('Transcript Name: ' + transcript_name)
begin
s3_client.head_object(bucket: s3_source, key: transcript_name)
rescue Aws::S3::Errors::NotFound
Sidekiq::Logging.logger.warn('Transcript not found.')
Hyrax.logger.warn('Transcript not found.')

Check warning on line 89 in app/services/spot/derivatives/video_derivative_service.rb

View check run for this annotation

Codecov / codecov/patch

app/services/spot/derivatives/video_derivative_service.rb#L88-L89

Added lines #L88 - L89 were not covered by tests
else
# enqueue job
Spot::TranscriptJob.perform_later(file_set: file_set, transcript_name: transcript_name)
Sidekiq::Logging.logger.warn { 'Transcript job enqueued.' }
Hyrax.logger.warn { 'Transcript job enqueued.' }
end
end

Expand Down

0 comments on commit 077b9a9

Please sign in to comment.