require 'sidekiq'
require 'travis/github_sync/services/sync_user'

module Travis
  module GithubSync
    module Workers
      class SyncUser
        include ::Sidekiq::Worker

        def perform(user_id, options = {})
          Services::SyncUser.new(user_id, options).run
        end
      end
    end
  end
end

# Change this in api, and whoever also enqueues syncs: Use Sidekiq::Client.push
module Travis::Sidekiq
  SynchronizeUser = Travis::GithubSync::Workers::SyncUser
  AutoSyncUser    = Travis::GithubSync::Workers::SyncUser # TODO can be removed after 2015-07-06
end
