Skip to content
This repository has been archived by the owner on May 10, 2018. It is now read-only.

Commit

Permalink
always use sidekiq for user sync
Browse files Browse the repository at this point in the history
  • Loading branch information
rkh committed Mar 19, 2013
1 parent e36e02b commit 9a34028
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
1 change: 0 additions & 1 deletion .travis.yml
@@ -1,7 +1,6 @@
language: ruby
services:
- redis
- rabbitmq
rvm:
- jruby-19mode
jdk:
Expand Down
13 changes: 2 additions & 11 deletions lib/travis/services/sync_user_.rb
Expand Up @@ -10,13 +10,8 @@ def run
end

def trigger_sync
if Travis::Features.user_active?(:sync_via_sidekiq, user) or Travis::Features.enabled_for_all?(:sync_via_sidekiq)
logger.info("Synchronizing via Sidekiq for user: #{user.login}")
Travis::Sidekiq::SynchronizeUser.perform_async(user.id)
else
logger.info("Synchronizing via AMQP for user: #{user.login}")
publisher.publish({ :user_id => user.id }, :type => 'sync')
end
logger.info("Synchronizing via Sidekiq for user: #{user.login}")
Travis::Sidekiq::SynchronizeUser.perform_async(user.id)
user.update_column(:is_syncing, true)
true
end
Expand All @@ -25,10 +20,6 @@ def user
# TODO check that clients are only passing the id
@user ||= current_user || User.find(params[:id])
end

def publisher
Travis::Amqp::Publisher.new('sync.user')
end
end
end
end

0 comments on commit 9a34028

Please sign in to comment.