whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject [whimsy] branch master updated: Check for stale cache
Date Mon, 25 Nov 2019 09:12:30 GMT
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 <sebb@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)
 


Mime
View raw message