Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/controllers/responses.js
Original file line number Diff line number Diff line change
Expand Up @@ -988,7 +988,7 @@ function handleExport(req, res, type) {
var metadata = doc.exports[type];

// See when we kicked off the export. If it was a long time ago, then we need to kick off a background task.
if (metadata.requested < now - exportDuration) {
if (metadata.requested < now - exportRequestDuration) {
console.log(util.format('info at=export event=generate reason=stale_metadata request_time=%d now=%d export_duration=%d', metadata.requested, now, exportDuration));
generate();
return;
Expand Down Expand Up @@ -1021,6 +1021,7 @@ function handleExport(req, res, type) {

var lastModifiedText = head.headers['last-modified'];
var lastModified = new Date(lastModifiedText);

// If the file exists and is old, kick off a background task.
if (!lastModifiedText || lastModified < now - exportDuration || lastModified < metadata.requested) {
console.log(util.format('info at=export event=generate reason=stale_export export_time=%d now=%d export_duration=%d', lastModified, now, exportDuration));
Expand Down