Round hour up to nearest day (#3723)

* Update storage.js

* Update storage.js
This commit is contained in:
Hugo Xu 2018-05-16 09:01:40 -06:00 committed by Raymond Hill
parent 5edc5275de
commit 25786c3257
1 changed files with 4 additions and 1 deletions

View File

@ -765,9 +765,12 @@
} }
} }
// Extract update frequency information // Extract update frequency information
matches = head.match(/(?:^|\n)(?:!|# )[\t ]*Expires:[\t ]*(\d+)[\t ]*day/i); matches = head.match(/(?:^|\n)(?:!|# )[\t ]*Expires:[\t ]*(\d+)[\t ]*(day|hour)/i);
if ( matches !== null ) { if ( matches !== null ) {
v = Math.max(parseInt(matches[1], 10), 1); v = Math.max(parseInt(matches[1], 10), 1);
if ( matches[2].toLowerCase() === 'hour' ) {
v = Math.ceil(v / 24);
}
if ( v !== listEntry.updateAfter ) { if ( v !== listEntry.updateAfter ) {
this.assets.registerAssetSource(assetKey, { updateAfter: v }); this.assets.registerAssetSource(assetKey, { updateAfter: v });
} }