aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2022-12-02 19:22:19 +0000
committerMario <mario@mariovavti.com>2022-12-02 19:22:19 +0000
commit2bb58843ab303ba3e1a4a2c0c5a64138852ebbe0 (patch)
tree1e85f560122aae0b30dfe5a55c3de90fbce64ed1 /include
parentd16b6c3838cd76eb7ce336444cbd37774857b64f (diff)
downloadvolse-hubzilla-2bb58843ab303ba3e1a4a2c0c5a64138852ebbe0.tar.gz
volse-hubzilla-2bb58843ab303ba3e1a4a2c0c5a64138852ebbe0.tar.bz2
volse-hubzilla-2bb58843ab303ba3e1a4a2c0c5a64138852ebbe0.zip
move queueworker to core and bump version
Diffstat (limited to 'include')
-rw-r--r--include/hubloc.php8
-rw-r--r--include/items.php27
-rw-r--r--include/network.php17
3 files changed, 30 insertions, 22 deletions
diff --git a/include/hubloc.php b/include/hubloc.php
index bf5d8f120..016d82f23 100644
--- a/include/hubloc.php
+++ b/include/hubloc.php
@@ -155,8 +155,8 @@ function remove_obsolete_hublocs() {
logger('remove_obsolete_hublocs: removing ' . count($r) . ' hublocs.');
- $interval = ((get_config('system', 'delivery_interval') !== false)
- ? intval(get_config('system', 'delivery_interval')) : 2 );
+ //$interval = ((get_config('system', 'delivery_interval') !== false)
+ //? intval(get_config('system', 'delivery_interval')) : 2 );
foreach($r as $rr) {
q("update hubloc set hubloc_deleted = 1 where hubloc_id = %d",
@@ -168,8 +168,8 @@ function remove_obsolete_hublocs() {
);
if($x) {
Master::Summon(array('Notifier', 'refresh_all', $x[0]['channel_id']));
- if($interval)
- @time_sleep_until(microtime(true) + (float) $interval);
+ //if($interval)
+ //@time_sleep_until(microtime(true) + (float) $interval);
}
}
}
diff --git a/include/items.php b/include/items.php
index 752251a7e..73fd584e1 100644
--- a/include/items.php
+++ b/include/items.php
@@ -4124,21 +4124,24 @@ function posted_dates($uid,$wall) {
*/
function fetch_post_tags($items, $link = false) {
- $tag_finder = array();
- if($items) {
- foreach($items as $item) {
- if(is_array($item)) {
- if(array_key_exists('item_id',$item)) {
- if(! in_array($item['item_id'],$tag_finder))
- $tag_finder[] = $item['item_id'];
- }
- else {
- if(! in_array($item['id'],$tag_finder))
- $tag_finder[] = $item['id'];
- }
+ if (!is_array($items) || !$items) {
+ return $items;
+ }
+
+ $tag_finder = [];
+ foreach($items as $item) {
+ if(is_array($item)) {
+ if(array_key_exists('item_id',$item)) {
+ if(! in_array($item['item_id'],$tag_finder))
+ $tag_finder[] = $item['item_id'];
+ }
+ else {
+ if(! in_array($item['id'],$tag_finder))
+ $tag_finder[] = $item['id'];
}
}
}
+
$tag_finder_str = implode(', ', $tag_finder);
if(strlen($tag_finder_str)) {
diff --git a/include/network.php b/include/network.php
index 36859bc2f..7deffe06c 100644
--- a/include/network.php
+++ b/include/network.php
@@ -1467,7 +1467,7 @@ function do_delivery($deliveries, $force = false) {
if(! (is_array($deliveries) && count($deliveries)))
return;
-
+ /*
$x = q("select count(outq_hash) as total from outq where outq_delivered = 0");
if(intval($x[0]['total']) > intval(get_config('system','force_queue_threshold',3000)) && (! $force)) {
logger('immediate delivery deferred.', LOGGER_DEBUG, LOG_INFO);
@@ -1478,8 +1478,10 @@ function do_delivery($deliveries, $force = false) {
}
+
$interval = ((get_config('system','delivery_interval') !== false)
? intval(get_config('system','delivery_interval')) : 2 );
+ */
$deliveries_per_process = intval(get_config('system','delivery_batch_count'));
@@ -1487,7 +1489,7 @@ function do_delivery($deliveries, $force = false) {
$deliveries_per_process = 1;
- $deliver = array();
+ $deliver = [];
foreach($deliveries as $d) {
if(! $d)
@@ -1496,17 +1498,20 @@ function do_delivery($deliveries, $force = false) {
$deliver[] = $d;
if(count($deliver) >= $deliveries_per_process) {
- Zotlabs\Daemon\Master::Summon(array('Deliver',$deliver));
- $deliver = array();
+ Zotlabs\Daemon\Master::Summon(['Deliver', $deliver]);
+ $deliver = [];
+ /*
if($interval)
@time_sleep_until(microtime(true) + (float) $interval);
+ */
}
}
// catch any stragglers
- if($deliver)
- Zotlabs\Daemon\Master::Summon(array('Deliver',$deliver));
+ if($deliver) {
+ Zotlabs\Daemon\Master::Summon(['Deliver', $deliver]);
+ }
}