Skip to content

Commit ee36d4a

Browse files
committed
Solidifie la synchro github
1 parent 1519677 commit ee36d4a

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

lib/tasks/dinum.rake

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ module Dinum
7373
next
7474
end
7575

76-
return if host.url == "https://github.com" # Github is handled in a separate task
76+
sync_host_repositories = sync_repositories && host.url != "https://github.com" # Github is handled in a separate task
7777

7878
puts "Syncing #{host.name} with #{owners.size} owners"
7979

@@ -87,7 +87,7 @@ module Dinum
8787
next if dry
8888
owner = host.sync_owner(owner_name)
8989
if owner
90-
if sync_repositories
90+
if sync_host_repositories
9191
host.sync_owner_repositories(owner)
9292
owner.update_repositories_count
9393
owner_without_repos.append owner if owner.repositories_count == 0
@@ -324,6 +324,8 @@ namespace :dinum do
324324
end
325325
end
326326
end
327+
Repository.counter_culture_fix_counts
328+
Owner.counter_culture_fix_counts
327329
end
328330

329331
class GithubApiEstimator
@@ -379,6 +381,7 @@ namespace :dinum do
379381

380382
puts "Finished syncing #{owner.name}, remaining api calls: #{remaining}, Syncing extra details"
381383
owner.repositories.each do |repo|
384+
puts "Syncing extra details for #{repo.full_name}"
382385
repo.sync_extra_details(force: true)
383386
end
384387

@@ -391,14 +394,15 @@ namespace :dinum do
391394
puts "Time elapsed: #{Time.now - started_at}"
392395
puts "Seconds per repository: #{(Time.now - started_at) / repositories_synced}"
393396

394-
if Time.now - started_at > 5.hours
397+
if Time.now - started_at > 11.hours
395398
puts "Time limit reached, stopping"
396399
break
397400
end
398401
rescue StandardError => e
399402
puts "Error: #{e}"
400403
File.write("/var/log/github_synchro_error.log", "#{Time.now} #{owner.name} - #{e}\n", mode: "a")
401404
end
405+
puts "Finished syncing github"
402406
end
403407
end
404408

0 commit comments

Comments
 (0)