Added extra vault error checking
This commit is contained in:
parent
519e2cced5
commit
7e4f59f322
11
vendors/shells/vault.php
vendored
11
vendors/shells/vault.php
vendored
|
|
@ -41,7 +41,7 @@ class VaultShell extends Shell {
|
||||||
$processed_dir = '/var/www/cakephp/app/processed_vaultmsgs';
|
$processed_dir = '/var/www/cakephp/app/processed_vaultmsgs';
|
||||||
$lockfile = '/var/www/cakephp/app/vault.lock';
|
$lockfile = '/var/www/cakephp/app/vault.lock';
|
||||||
}
|
}
|
||||||
|
|
||||||
if(file_exists($lockfile)) {
|
if(file_exists($lockfile)) {
|
||||||
die("Error: Another process is currently running. Terminating this one");
|
die("Error: Another process is currently running. Terminating this one");
|
||||||
}
|
}
|
||||||
|
|
@ -50,7 +50,7 @@ class VaultShell extends Shell {
|
||||||
die("FATAL ERROR: Unable to create vault.lock");
|
die("FATAL ERROR: Unable to create vault.lock");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Find the strings we want to look for in the subjects. Build arrays
|
/* Find the strings we want to look for in the subjects. Build arrays
|
||||||
* using the string as the keys, IDs as the value
|
* using the string as the keys, IDs as the value
|
||||||
|
|
@ -116,7 +116,12 @@ class VaultShell extends Shell {
|
||||||
if(!$content) {
|
if(!$content) {
|
||||||
echo "No Content Found. Ignoring this email\n";
|
echo "No Content Found. Ignoring this email\n";
|
||||||
if(!$this->makeSymlink($email_filename, $vault_dir, $processed_dir)) {
|
if(!$this->makeSymlink($email_filename, $vault_dir, $processed_dir)) {
|
||||||
die("Unable to make symlink to process this email Critical error: {$email_filename}");
|
echo "Unable to make symlink to process this email Critical error: {$email_filename}\n";
|
||||||
|
|
||||||
|
if(!unlink($lockfile)) {
|
||||||
|
die("FATAL ERROR: Unable to remove vault.lock. No further Vault instances can run!");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
continue;
|
continue;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue