Keep retrying sending to remote server for 4 hours if error.

This commit is contained in:
Retro_Guy 2024-09-12 05:03:47 -07:00
parent 8dd12c02ed
commit 540a6e290f
1 changed files with 4 additions and 1 deletions

View File

@ -89,7 +89,10 @@ function post_articles($ns, $spooldir)
fclose($message_fp);
$response = line_read($ns);
if (strcmp(substr($response, 0, 3), "441") == 0) {
rename($outgoing_dir . $message, $fail_dir . $message);
// Keep retrying outgoing message for 4 hours in case of temporary issue
if(filemtime($outgoing_dir . $message) < (time() - 14400)) {
rename($outgoing_dir . $message, $fail_dir . $message);
}
file_put_contents($logfile, "\n" . format_log_date() . " " . $config_name . " POST Failed: " . $response, FILE_APPEND);
}
if (strcmp(substr($response, 0, 3), "240") == 0) {