Commit 6d846b0b779330ad5352f4b78320fd0c6aa71ec3:
update cache when full parses complete
Branch: refs/heads/master
Author: Sam Ruby <[email protected]>
Committer: Sam Ruby <[email protected]>
Pusher: rubys <[email protected]>
------------------------------------------------------------
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