Permalink
Browse files

Don't always check the cache timestamp

  • Loading branch information...
1 parent ea42944 commit f1378051a8a79d6a94660a9d955c648dc782fee9 @probablycorey committed Jun 24, 2011
Showing with 5 additions and 3 deletions.
  1. +5 −3 lib/stdlib/helpers/cache.lua
View
8 lib/stdlib/helpers/cache.lua
@@ -9,9 +9,11 @@ function wax.cache.get(key, maxAge)
if not wax.filesystem.isFile(path) then return nil end
- local fileAge = os.time() - wax.filesystem.attributes(path).modifiedAt
- if maxAge and fileAge > maxAge then
- return nil
+ if maxAge then
+ local fileAge = os.time() - wax.filesystem.attributes(path).modifiedAt
+ if fileAge > maxAge then
+ return nil
+ end
end
local success, result = pcall(function()

0 comments on commit f137805

Please sign in to comment.