
- Re-factor - Remove code for notifications - Remove addons - Remove travis-core gem. - Ignore logs directory only - Move core tests to spec/lib
27 lines
614 B
Ruby
27 lines
614 B
Ruby
require 'travis/sidekiq/synchronize_user'
|
|
require 'travis/services/base'
|
|
|
|
module Travis
|
|
module Services
|
|
class SyncUser < Base
|
|
register :sync_user
|
|
|
|
def run
|
|
trigger_sync unless user.syncing?
|
|
end
|
|
|
|
def trigger_sync
|
|
logger.info("Synchronizing via Sidekiq for user: #{user.login}")
|
|
Travis::Sidekiq::SynchronizeUser.perform_async(user.id)
|
|
user.update_column(:is_syncing, true)
|
|
true
|
|
end
|
|
|
|
def user
|
|
# TODO check that clients are only passing the id
|
|
@user ||= current_user || User.find(params[:id])
|
|
end
|
|
end
|
|
end
|
|
end
|