From 8b79eb8698517d35fa80ed13123cdfbf0f939b75 Mon Sep 17 00:00:00 2001 From: Jamie Gaskins Date: Fri, 9 Jul 2021 09:58:20 -0400 Subject: [PATCH] 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. --- app/workers/github_repos/repo_sync_worker.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/workers/github_repos/repo_sync_worker.rb b/app/workers/github_repos/repo_sync_worker.rb index e5efc15e9..22c091400 100644 --- a/app/workers/github_repos/repo_sync_worker.rb +++ b/app/workers/github_repos/repo_sync_worker.rb @@ -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