From c49a92ecc67cd2f3144d07ea9b21ff073b5c3165 Mon Sep 17 00:00:00 2001 From: Karl Cordes Date: Mon, 21 Mar 2011 14:43:56 +1100 Subject: [PATCH] Added sleep to Vault while loop --- vendors/shells/vault.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/vendors/shells/vault.php b/vendors/shells/vault.php index 054d1f3d..8f4d456d 100755 --- a/vendors/shells/vault.php +++ b/vendors/shells/vault.php @@ -27,7 +27,7 @@ class VaultShell extends Shell { /****************************************************** * Config Variables * *****************************************************/ - $testing = 0; //Whether to actually move the emails. 1=test, 0=production + $testing = 1; //Whether to actually move the emails. 1=test, 0=production if($testing == 1) { @@ -50,6 +50,12 @@ class VaultShell extends Shell { $processed = scandir($processed_dir); $new = array_diff($emails, $processed); + if(count($new) == 0) { + echo "\rWaiting for new messages"; + sleep(60); + continue; + } + /* Find the strings we want to look for in the subjects. Build arrays