Class: InchCI::Worker::User::UpdateProjects

Inherits:
Object
  • Object
show all
Includes:
Sidekiq::Worker
Defined in:
lib/inch_ci/worker/user/update_projects.rb

Overview

The UpdateProjects worker is responsible for updating a user's projects.

Constant Summary collapse

ORIGIN =
'github_sync'
TRIGGER =
'github_sync'

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.enqueue(id) ⇒ void

This method returns an undefined value.

Parameters:

  • id (Fixnum)

    the user's ID


16
17
18
# File 'lib/inch_ci/worker/user/update_projects.rb', line 16

def self.enqueue(id)
  perform_async(id)
end

Instance Method Details

#perform(id) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.


21
22
23
24
25
26
27
# File 'lib/inch_ci/worker/user/update_projects.rb', line 21

def perform(id)
  user = Store::FindUserById.call(id)
  service_name = user.provider
  if service_name == "github"
    update_via_github(user)
  end
end