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.2.1 app/workers/sync/icons_worker.rb
smartkiosk-client-0.2 app/workers/sync/icons_worker.rb
smartkiosk-client-0.1.19 app/workers/sync/icons_worker.rb
smartkiosk-client-0.1.18 app/workers/sync/icons_worker.rb
smartkiosk-client-0.1.17 app/workers/sync/icons_worker.rb
smartkiosk-client-0.1.16 app/workers/sync/icons_worker.rb
smartkiosk-client-0.1.15 app/workers/sync/icons_worker.rb
smartkiosk-client-0.1.14 app/workers/sync/icons_worker.rb
smartkiosk-client-0.1.13 app/workers/sync/icons_worker.rb
smartkiosk-client-0.1.12 app/workers/sync/icons_worker.rb
smartkiosk-client-0.1.11 app/workers/sync/icons_worker.rb
smartkiosk-client-0.1.10 app/workers/sync/icons_worker.rb
smartkiosk-client-0.1.9 app/workers/sync/icons_worker.rb
smartkiosk-client-0.1.8 app/workers/sync/icons_worker.rb
smartkiosk-client-0.1.7 app/workers/sync/icons_worker.rb
smartkiosk-client-0.1.6 app/workers/sync/icons_worker.rb
smartkiosk-client-0.1.5 app/workers/sync/icons_worker.rb
smartkiosk-client-0.1.4 app/workers/sync/icons_worker.rb
smartkiosk-client-0.1.3 app/workers/sync/icons_worker.rb
smartkiosk-client-0.1.2 app/workers/sync/icons_worker.rb