Sha256: e902bf073ba11dce0c6a2aace6f4a8b3532c31626f05965df5b26ec2cfdf2795

Contents?: true

Size: 419 Bytes

Versions: 34

Compression:

Stored size: 419 Bytes

Contents

require 'rest-client'

module Sync
  class IconsWorker
    include Sidekiq::Worker

    sidekiq_options :retry => false, :queue => :sync

    def perform(model, id, url)
      entity  = model.constantize.find(id)
      attempt = entity.update_attributes :remote_icon_url => "#{Terminal.config.host}/#{url}"

      unless attempt
        Sync::IconsWorker.perform_in(1.minute, model, id, url)
      end
    end
  end
end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
smartkiosk-client-0.1.1 app/workers/sync/icons_worker.rb
smartkiosk-client-0.1.0 app/workers/sync/icons_worker.rb
smartkiosk-client-0.0.28 app/workers/sync/icons_worker.rb
smartkiosk-client-0.0.26 app/workers/sync/icons_worker.rb
smartkiosk-client-0.0.25 app/workers/sync/icons_worker.rb
smartkiosk-client-0.0.24 app/workers/sync/icons_worker.rb
smartkiosk-client-0.0.23 app/workers/sync/icons_worker.rb
smartkiosk-client-0.0.22 app/workers/sync/icons_worker.rb
smartkiosk-client-0.0.21 app/workers/sync/icons_worker.rb
smartkiosk-client-0.0.20 app/workers/sync/icons_worker.rb
smartkiosk-client-0.0.19 app/workers/sync/icons_worker.rb
smartkiosk-client-0.0.18 app/workers/sync/icons_worker.rb
smartkiosk-client-0.0.17 app/workers/sync/icons_worker.rb
smartkiosk-client-0.0.16 app/workers/sync/icons_worker.rb