mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-23 21:01:08 +00:00
Bug 1751283 - Compute age from timestamp for Telemetry r=gbeckley
Differential Revision: https://phabricator.services.mozilla.com/D136536
This commit is contained in:
parent
db24c6826c
commit
76afa0f737
@ -338,8 +338,7 @@ var Utils = {
|
||||
serverTimeMillis += cacheAgeSeconds * 1000;
|
||||
|
||||
// Age of data (time between publication and now).
|
||||
let lastModifiedMillis = Date.parse(response.headers.get("Last-Modified"));
|
||||
const ageSeconds = (serverTimeMillis - lastModifiedMillis) / 1000;
|
||||
const ageSeconds = (serverTimeMillis - timestamp) / 1000;
|
||||
|
||||
// Check if the server asked the clients to back off.
|
||||
let backoffSeconds;
|
||||
|
@ -64,7 +64,6 @@ function serveChangesEntries(serverTime, entries) {
|
||||
const latest = entries[0]?.last_modified ?? 42;
|
||||
if (entries.length) {
|
||||
response.setHeader("ETag", `"${latest}"`);
|
||||
response.setHeader("Last-Modified", new Date(latest).toGMTString());
|
||||
}
|
||||
response.write(JSON.stringify({ timestamp: latest, changes: entries }));
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user