You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whimsical.apache.org by Sam Ruby <ru...@apache.org> on 2016/03/17 15:44:08 UTC

[whimsy.git] [1/1] Commit 6d846b0: update cache when full parses complete

Commit 6d846b0b779330ad5352f4b78320fd0c6aa71ec3:
    update cache when full parses complete


Branch: refs/heads/master
Author: Sam Ruby <ru...@intertwingly.net>
Committer: Sam Ruby <ru...@intertwingly.net>
Pusher: rubys <ru...@apache.org>

------------------------------------------------------------
www/board/agenda/models/agenda.rb                            | +++ -
------------------------------------------------------------
4 changes: 3 additions, 1 deletions.
------------------------------------------------------------


diff --git a/www/board/agenda/models/agenda.rb b/www/board/agenda/models/agenda.rb
index 503d42a..ae6d22c 100755
--- a/www/board/agenda/models/agenda.rb
+++ b/www/board/agenda/models/agenda.rb
@@ -25,8 +25,10 @@ def self.update_cache(file, path, contents, quick)
       digest: Digest::SHA256.base64digest(contents)
     }
 
+    # update cache if there wasn't a previous entry, the digest changed,
+    # or the previous entry was the result of a 'quick' parse.
     current = IPC[file]
-    unless current and current[:digest] == update[:digest]
+    if not current or current[:digest]!=update[:digest] or current[:mtime]<=0
       IPC[file] = update
       IPC.post type: :agenda, file: file, digest: update[:digest] unless quick
     end