Skip to content

Commit 186e0c8

Browse files
committed
Increases the scope of the 'mark_removed_repos' task to a broader 'update_repos' one
1 parent c7a0755 commit 186e0c8

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

lib/tasks/schedule.rake

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,12 @@ namespace :schedule do
3838
return GithubFetcher::Repo.new(user_name: "rails", name: "rails").success?
3939
end
4040

41-
desc "Checks if repos have been deleted on GitHub"
42-
task mark_removed_repos: :environment do
41+
desc "Update repos information"
42+
task update_repos: :environment do
4343
raise "GITHUB API APPEARS TO BE DOWN" unless github_api_up?
4444

45-
Repo.select(:id, :user_name, :name).find_each(batch_size: 100) do |repo|
46-
fetcher = GithubFetcher::Repo.new(user_name: repo.user_name, name: repo.name)
47-
fetcher.call(retry_on_bad_token: 5)
48-
49-
if fetcher.response.status == 404
50-
repo.update!(removed_from_github: true)
51-
end
45+
Repo.find_each(batch_size: 100) do |repo|
46+
repo.update_repo_info!
5247
end
5348
end
5449

0 commit comments

Comments
 (0)