Class: GithubUpdateWorker

Inherits:
Object
  • Object
show all
Includes:
Sidekiq::Worker
Defined in:
app/workers/github_update_worker.rb

Instance Method Summary collapse

Instance Method Details

#perform(repo_name, token = nil) ⇒ Object



5
6
7
8
9
10
11
12
13
# File 'app/workers/github_update_worker.rb', line 5

def perform(repo_name, token = nil)
  token = token || AuthToken.token
  github_repository = GithubRepository.find_by_full_name(repo_name)
  if github_repository
    github_repository.update_from_github
  else
    GithubRepository.create_from_github(repo_name, token)
  end
end