aboutsummaryrefslogtreecommitdiffstats
path: root/include/queue.php
diff options
context:
space:
mode:
authorfabrixxm <fabrix.xm@gmail.com>2011-01-29 09:39:38 +0100
committerfabrixxm <fabrix.xm@gmail.com>2011-01-29 09:39:38 +0100
commit5b35ceefb96f7122f210e2160c45bb4f8b9917b8 (patch)
treeb687508bd7247100ac0dd51ecf36aed9ea97d5cd /include/queue.php
parent8257b1b684d2c6087a93ae690aa27c907e578aa3 (diff)
parent26cc2e02fe6e075cd35a3069edbc006219f5b435 (diff)
downloadvolse-hubzilla-5b35ceefb96f7122f210e2160c45bb4f8b9917b8.tar.gz
volse-hubzilla-5b35ceefb96f7122f210e2160c45bb4f8b9917b8.tar.bz2
volse-hubzilla-5b35ceefb96f7122f210e2160c45bb4f8b9917b8.zip
Merge branch 'friendika-master'
Diffstat (limited to 'include/queue.php')
-rw-r--r--include/queue.php35
1 files changed, 22 insertions, 13 deletions
diff --git a/include/queue.php b/include/queue.php
index 96ddfa81b..d4fc7dbd6 100644
--- a/include/queue.php
+++ b/include/queue.php
@@ -1,5 +1,5 @@
<?php
-
+require_once("boot.php");
function update_queue_time($id) {
logger('queue: requeue item ' . $id);
@@ -16,14 +16,19 @@ function remove_queue_item($id) {
);
}
- require_once("boot.php");
-
- $a = new App;
+function queue_run($argv, $argc){
+ global $a, $db;
- @include(".htconfig.php");
- require_once("dba.php");
- $db = new dba($db_host, $db_user, $db_pass, $db_data);
- unset($db_host, $db_user, $db_pass, $db_data);
+ if(is_null($a)){
+ $a = new App;
+ }
+
+ if(is_null($db)){
+ @include(".htconfig.php");
+ require_once("dba.php");
+ $db = new dba($db_host, $db_user, $db_pass, $db_data);
+ unset($db_host, $db_user, $db_pass, $db_data);
+ };
require_once("session.php");
@@ -50,9 +55,9 @@ function remove_queue_item($id) {
$r = q("SELECT `id` FROM `queue` WHERE `last` < UTC_TIMESTAMP() - INTERVAL 15 MINUTE ");
- if(! count($r))
- killme();
-
+ if(! count($r)){
+ return;
+ }
// delivery loop
require_once('include/salmon.php');
@@ -118,7 +123,11 @@ function remove_queue_item($id) {
}
}
- killme();
+ return;
- // NOTREACHED
+}
+if (array_search(__file__,get_included_files())===0){
+ queue_run($argv,$argc);
+ killme();
+}