Skip to content

Commit

Permalink
add after_processing hook to uploads' workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
branch14 committed Oct 26, 2017
1 parent afb57d2 commit 9acc4e9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion app/models/talk.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ class Talk < ActiveRecord::Base
transitions from: :processing, to: :archived,
on_transition: :after_processing
# or by user upload
transitions from: :pending, to: :archived
transitions from: :pending, to: :archived,
on_transition: :after_processing
# in rare case we might to override a talk
# which has never been enqueued
transitions from: :postlive, to: :archived
Expand Down
8 changes: 4 additions & 4 deletions lib/audio_worker/runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -167,14 +167,14 @@ def run(job)
puts "Target bucket: #{target_bucket}"
puts "Job Type: #{type}"

# pull manifest file
manifest_url = "#{target_bucket}/manifest.yml"
s3_cp(manifest_url, path, target_region)

case type

when "Job::Archive"

# pull manifest file
manifest_url = "#{target_bucket}/manifest.yml"
s3_cp(manifest_url, path, target_region)

# based on content pull source files
manifest_path = File.join(path, 'manifest.yml')
raise "No manifest file!" unless File.exist?(manifest_path)
Expand Down

0 comments on commit 9acc4e9

Please sign in to comment.