Only update GithubRepos once in RepoSyncWorker (#14175)

Touching the GithubRepo invokes GithubRepo#clear_caches, so calling
`update` and then `touch` calls `clear_caches` *twice*. This pulls it
back to calling it once.
This commit is contained in:
Jamie Gaskins 2021-07-09 09:58:20 -04:00 committed by GitHub
parent 6a93ad914a
commit 8b79eb8698
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -27,8 +27,10 @@ module GithubRepos
watchers_count: fetched_repo.watchers,
stargazers_count: fetched_repo.stargazers_count,
info_hash: fetched_repo.to_hash,
# Touch `updated_at` even if nothing here was updated. See PR #12853
# for more details.
updated_at: Time.current,
)
repo.touch(:updated_at)
if repo.user&.github_repos_updated_at&.before?(TOUCH_USER_COOLDOWN.ago)
repo.user.touch(:github_repos_updated_at)
end