Skip to content

Commit e6d4876

Browse files
authored
Compare hashes for date skip (#1279)
* This sort of usage is a reason this was implemented Post #1067 and loosely related to #819 Auto-merge
1 parent 3789a51 commit e6d4876

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

controllers/scriptStorage.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -1577,7 +1577,12 @@ exports.storeScript = function (aUser, aMeta, aBuf, aUpdate, aCallback) {
15771577
// Okay to update
15781578
aScript.hash = crypto.createHash('sha512').update(aBuf).digest('hex');
15791579

1580-
aScript.updated = new Date();
1580+
// Check hash here against old and don't increment Script model date if same.
1581+
// Allows sync reset for GH and resave/reset to S3 if needed
1582+
// Covers issue with GitHub cache serving old raw
1583+
if (script.hash !== aScript.hash) {
1584+
aScript.updated = new Date();
1585+
}
15811586

15821587
if (findMeta(script.meta, 'UserScript.version.0.value') !==
15831588
findMeta(aMeta, 'UserScript.version.0.value')) {

0 commit comments

Comments
 (0)