Skip to content

Commit

Permalink
Merge pull request #5 from garrows/fix/bad-cache
Browse files Browse the repository at this point in the history
Fixed empty cache file
  • Loading branch information
garrows committed Jul 13, 2015
2 parents b40fa8e + 8218723 commit 325c0b1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ module.exports = function (_config) {
createdAt = cast(stat.mtime, 'date').getTime();
} catch(e) {};

if(stat && now - createdAt < config.ttl) {
if(stat && now - createdAt < config.ttl && stat.size > 0) {

var gmImage = gm(config.cacheFolder + '/' + image.hash)
.options(gmOptions)
Expand Down

0 comments on commit 325c0b1

Please sign in to comment.