Don’t save rules/metadata when using cache & content hasn’t changed

parent 01b42080
......@@ -157,7 +157,7 @@ class Blockdown
@useContentCache = false
break
else
@log.info "\t Rule partials folder does not exist. Not using cache!"
@log.info "\t Rule partials folder does not exist. Not using cache!"
@useContentCache = false
......@@ -709,14 +709,16 @@ Better is a Safari content blocker for <a href='https://itunes.apple.com/us/app/
#
saveBlockerListJSON: (dataDirectory) =>
# if @contentHasNotChanged
# console.log("\t✓ Content has not changed. Not saving blocker list JSON or its metadata file.")
# return Promise.resolve()
if @useContentCache && @contentHasNotChanged
console.log("\t✓ Content has not changed and we’re using the cache. Not saving blocker list JSON or its metadata file.")
return Promise.resolve()
#
# Content has changed. Save the blocker list and metadata files.
#
console.log("\t✓ Saving new blockerList.json and metadata.json files.")
blockerListJSONFilePath = path.join dataDirectory, 'blockerList.json'
metadataFilePath = path.join dataDirectory, 'metadata.json'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment