Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issue #66 fix #69

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
11 changes: 6 additions & 5 deletions vesuvius/mod/pfif/main.inc
Original file line number Diff line number Diff line change
Expand Up @@ -199,20 +199,21 @@ function shn_pfif_status_code() {
$export_err = $log_dir . 'export.err';

// Check both output files to make sure they are getting updated.
$lastImportOut = filemtime($import_out);
$lastExportOut = filemtime($export_out);
$lastImportOut = (file_exists($import_out))?filemtime($import_out):false;
$lastExportOut = (file_exists($export_out))?filemtime($export_out):false;
// we are interested in the number of seconds since the oldest timestamp.
$deltaImportOut = date("U") - $lastImportOut;
$deltaExportOut = date("U") - $lastExportOut;
$deltaOut = ($deltaImportOut > $deltaExportOut)? $deltaImportOut:$deltaExportOut;

// Check for non-zero-size error file.
$errors = filesize($export_err)!=0 || filesize($import_err)!=0;
$errors = (file_exists($export_err) && filesize($export_err)!=0) ||
(file_exists($import_err) && filesize($import_err)!=0);

// Check both error files to make sure they aren't recently updated.
// (If errors only occur intermittantly, we treat it as a warning.)
$lastImportErr = filemtime($import_err);
$lastExportErr = filemtime($export_err);
$lastImportErr = (file_exists($import_err))?filemtime($import_err):false;
$lastExportErr = (file_exists($export_err))?filemtime($export_err):false;
// we are interested in the number of seconds since the most recent timestamp.
$deltaImportErr = date("U") - $lastImportErr;
$deltaExportErr = date("U") - $lastExportErr;
Expand Down