Skip to content

Commit 25786c3

Browse files
jspenguin2017gorhill
authored andcommitted
Round hour up to nearest day (gorhill#3723)
* Update storage.js * Update storage.js
1 parent 5edc527 commit 25786c3

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/js/storage.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -765,9 +765,12 @@
765765
}
766766
}
767767
// Extract update frequency information
768-
matches = head.match(/(?:^|\n)(?:!|# )[\t ]*Expires:[\t ]*(\d+)[\t ]*day/i);
768+
matches = head.match(/(?:^|\n)(?:!|# )[\t ]*Expires:[\t ]*(\d+)[\t ]*(day|hour)/i);
769769
if ( matches !== null ) {
770770
v = Math.max(parseInt(matches[1], 10), 1);
771+
if ( matches[2].toLowerCase() === 'hour' ) {
772+
v = Math.ceil(v / 24);
773+
}
771774
if ( v !== listEntry.updateAfter ) {
772775
this.assets.registerAssetSource(assetKey, { updateAfter: v });
773776
}

0 commit comments

Comments
 (0)