Skip to content

Commit

Permalink
[Framework] Bump version of fetch-filecache-for-crawling
Browse files Browse the repository at this point in the history
The new version follows HTTP cache expiration rules and let one control the
expiration behavior more precisely. Note parameters now need to be explicitly
set, the lib no longer reads them from `config.json` (that's a good thing, the
lib shouldn't require the embedding app to use that pattern).
  • Loading branch information
tidoust committed Jun 24, 2018
1 parent ae7ce49 commit 3c77708
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "web-roadmaps",
"dependencies": {
"ajv-cli": "^3.0.0",
"fetch-filecache-for-crawling": "^1.4.1",
"fetch-filecache-for-crawling": "^3.0.1",
"jsdom": "^11.8.0",
"mkdirp": "^0.5.1",
"ncp": "^2.0.0"
Expand Down
16 changes: 16 additions & 0 deletions tools/extract-impl-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -629,6 +629,22 @@ module.exports.extractImplData = extractImplData;


if (require.main === module) {
let config = {};
try {
config = requireFromWorkingDirectory('config.json');
}
catch (err) {}

if (config.cacheFolder) {
fetch.setParameter('cacheFolder', config.cacheFolder);
}
if (config.cacheRefresh) {
fetch.setParameter('refresh', config.cacheRefresh);
}
if (config.logToConsole) {
fetch.setParameter('logToConsole', config.logToConsole);
}

const files = process.argv.slice(2).map(file => {
let stat = fs.statSync(file);
if (stat.isDirectory()) {
Expand Down
10 changes: 10 additions & 0 deletions tools/extract-spec-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,16 @@ if (require.main === module) {
}
catch (err) {}

if (config.cacheFolder) {
fetch.setParameter('cacheFolder', config.cacheFolder);
}
if (config.cacheRefresh) {
fetch.setParameter('refresh', config.cacheRefresh);
}
if (config.logToConsole) {
fetch.setParameter('logToConsole', config.logToConsole);
}

// Read the W3C API key from the environment if defined there
if (process.env.W3C_API_KEY) {
config.w3cApiKey = process.env.W3C_API_KEY;
Expand Down

0 comments on commit 3c77708

Please sign in to comment.