aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorredmatrix <redmatrix@redmatrix.me>2015-12-15 00:42:19 -0800
committerredmatrix <redmatrix@redmatrix.me>2015-12-15 00:42:19 -0800
commitba463afbdcded70b88a48d76276d837a7e78ef0c (patch)
tree9075e08ad4e138125124a3ee79acfa95b472b224 /include
parent6f2a5117dc04267f7571314639e19265cfc21dec (diff)
downloadvolse-hubzilla-ba463afbdcded70b88a48d76276d837a7e78ef0c.tar.gz
volse-hubzilla-ba463afbdcded70b88a48d76276d837a7e78ef0c.tar.bz2
volse-hubzilla-ba463afbdcded70b88a48d76276d837a7e78ef0c.zip
even more queue api
Diffstat (limited to 'include')
-rw-r--r--include/deliver.php22
1 files changed, 7 insertions, 15 deletions
diff --git a/include/deliver.php b/include/deliver.php
index de93e316e..a333e6fe3 100644
--- a/include/deliver.php
+++ b/include/deliver.php
@@ -2,6 +2,7 @@
require_once('include/cli_startup.php');
require_once('include/zot.php');
+require_once('include/queue_fn.php');
function deliver_run($argv, $argc) {
@@ -90,17 +91,11 @@ function deliver_run($argv, $argc) {
dbesc($argv[$x])
);
- $y = q("delete from outq where outq_hash = '%s'",
- dbesc($argv[$x])
- );
-
+ remove_queue_item($argv[$x]);
}
else {
logger('deliver: queue post returned ' . $result['return_code'] . ' from ' . $r[0]['outq_posturl'],LOGGER_DEBUG);
- $y = q("update outq set outq_updated = '%s' where outq_hash = '%s'",
- dbesc(datetime_convert()),
- dbesc($argv[$x])
- );
+ update_queue_item($argv[$x]);
}
continue;
}
@@ -127,9 +122,9 @@ function deliver_run($argv, $argc) {
$msg = array('body' => json_encode(array('success' => true, 'pickup' => array(array('notify' => $notify,'message' => $m)))));
$dresult = zot_import($msg,z_root());
}
- $r = q("delete from outq where outq_hash = '%s'",
- dbesc($argv[$x])
- );
+
+ remove_queue_item($argv[$x]);
+
if($dresult && is_array($dresult)) {
foreach($dresult as $xx) {
if(is_array($xx) && array_key_exists('message_id',$xx)) {
@@ -162,10 +157,7 @@ function deliver_run($argv, $argc) {
else {
logger('deliver: remote zot delivery failed to ' . $r[0]['outq_posturl']);
logger('deliver: remote zot delivery fail data: ' . print_r($result,true), LOGGER_DATA);
- $y = q("update outq set outq_updated = '%s' where outq_hash = '%s'",
- dbesc(datetime_convert()),
- dbesc($argv[$x])
- );
+ update_queue_item($argv[$x],10);
}
}
}