You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whimsical.apache.org by se...@apache.org on 2019/11/25 09:12:30 UTC

[whimsy] branch master updated: Check for stale cache

This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git


The following commit(s) were added to refs/heads/master by this push:
     new 551fad0  Check for stale cache
551fad0 is described below

commit 551fad04f1d181d9e0458b90b2090cd2d7fd33b6
Author: Sebb <se...@apache.org>
AuthorDate: Mon Nov 25 09:11:28 2019 +0000

    Check for stale cache
---
 lib/whimsy/asf/git.rb | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/lib/whimsy/asf/git.rb b/lib/whimsy/asf/git.rb
index 4683987..de5fa6b 100644
--- a/lib/whimsy/asf/git.rb
+++ b/lib/whimsy/asf/git.rb
@@ -42,6 +42,11 @@ module ASF
       @semaphore.synchronize do
         git = Array(ASF::Config.get(:git)).map {|dir| dir.untaint}
 
+        # reload if repository changes
+        if File.exist?(REPOSITORY) && @@repository_mtime!=File.mtime(REPOSITORY)
+          @repos = nil
+        end
+
         unless @repos
           @@repository_mtime = File.exist?(REPOSITORY) && File.mtime(REPOSITORY)