Permalink
Browse files

Merge pull request #561 from travis-ci/sf-sync-queue

Talk to the Sync 2.0 queue
  • Loading branch information...
2 parents fd905d4 + 91b088f commit bf944c952724dd2f00ff0c466a5e217d10f73bea @svenfuchs svenfuchs committed on GitHub Sep 15, 2016
Showing with 10 additions and 2 deletions.
  1. +5 −1 lib/travis/services/sync_user.rb
  2. +5 −1 spec/travis/services/sync_user_spec.rb
@@ -12,7 +12,11 @@ def run
def trigger_sync
logger.info("Synchronizing via Sidekiq for user: #{user.login}")
- Travis::Sidekiq::SynchronizeUser.perform_async(user.id)
+ ::Sidekiq::Client.push(
+ 'queue' => 'sync',
+ 'class' => 'Travis::GithubSync::Worker',
+ 'args' => [:sync_user, user_id: user.id]
+ )
user.update_column(:is_syncing, true)
true
end
@@ -13,7 +13,11 @@
end
it 'enqueues a sync job' do
- Travis::Sidekiq::SynchronizeUser.expects(:perform_async).with(user.id)
+ ::Sidekiq::Client.expects(:push).with(
+ 'queue' => 'sync',
+ 'class' => 'Travis::GithubSync::Worker',
+ 'args' => [:sync_user, user_id: user.id]
+ )
service.run
end

0 comments on commit bf944c9

Please sign in to comment.