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
8 changes: 8 additions & 0 deletions servers.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,14 @@ function cleanup() {
if ($tmp = @fopen($tmpfile, 'x'))
break; // we have the temp file, so fetch new data

// If the temp file is stale (e.g. the writer crashed without cleanup),
// remove it and try again immediately
if (file_exists($tmpfile) && filemtime($tmpfile) < time() - 30) {
error_log("Stale lock file detected for $cachefile, removing");
unlink($tmpfile);
continue;
}

if (time() > $start + 20) { // don't wait forever
die("Can't obtain temporary file\n");
}
Expand Down