Skip to content

Commit

Permalink
Merge branch 'feature/docker-machine' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
x1wins committed Nov 14, 2020
2 parents 9e1d54c + d632dc0 commit 9d5fe54
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
2 changes: 2 additions & 0 deletions DOCKER-SWARM.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,8 @@ docker push 127.0.0.1:5000/cw-ovp
## Run stack
```
docker stack deploy --compose-file docker-stack.yml CW-OVP
docker image prune -a -f
docker exec -it 1f7193e6042e bundle exec rails webpacker:install
docker exec -it 1f7193e6042e bundle exec rake db:migrate
```
Expand Down
2 changes: 1 addition & 1 deletion app/workers/encode_worker.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class EncodeWorker
include Sidekiq::Worker
sidekiq_options retry: false, backtrace: true
sidekiq_options retry: 0, backtrace: true

def perform(encode_id)
encode = Encode.find(encode_id)
Expand Down
10 changes: 7 additions & 3 deletions app/workers/thumbnail_worker.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class ThumbnailWorker
include Sidekiq::Worker
sidekiq_options retry: false, backtrace: true
sidekiq_options retry: 0, backtrace: true

def perform(encode_id)
encode = Encode.find(encode_id)
Expand All @@ -18,8 +18,12 @@ def perform(encode_id)
thumbnail_file_full_path = "#{thumbnail_local_full_path}/#{thumbnail_filename}"
thumbnail_cmd = Bash::Thumbnail.call(uploaded_file_path, ss, thumbnail_file_full_path)
thumbnail_url = Storage::Url::Full::Thumbnail.call(encode, base_url, thumbnail_filename)
encode.assets.create(format: 'image', url: thumbnail_url)
encode.thumbnails.attach(io: File.open(thumbnail_file_full_path), filename: thumbnail_filename, content_type: "image/png")

ActiveRecord::Base.connection_pool.release_connection
ActiveRecord::Base.connection_pool.with_connection do
encode.assets.create(format: 'image', url: thumbnail_url)
encode.thumbnails.attach(io: File.open(thumbnail_file_full_path), filename: thumbnail_filename, content_type: "image/png")
end
message = "Extracted #{i}th Thumbnail"

cdn_bucket = ENV['CDN_BUCKET']
Expand Down

0 comments on commit 9d5fe54

Please sign in to comment.