]> git.mxchange.org Git - friendica.git/blobdiff - include/items.php
Degrade priority step by step
[friendica.git] / include / items.php
index eb307639098d6148419e70a1ca9e23d89e6af694..31a709fcbf2318ac80f01ed5024efba4cdec858d 100644 (file)
@@ -1139,7 +1139,7 @@ function item_store($arr, $force_parent = false, $notify = false, $dontcache = f
        check_item_notification($current_post, $uid);
 
        if ($notify) {
-               proc_run(PRIORITY_HIGH, "include/notifier.php", $notify_type, $current_post);
+               proc_run(array('priority' => PRIORITY_HIGH, 'dont_fork' => true), "include/notifier.php", $notify_type, $current_post);
        }
 
        return $current_post;
@@ -1430,7 +1430,7 @@ function tag_deliver($uid, $item_id) {
        );
        update_thread($item_id);
 
-       proc_run(PRIORITY_HIGH,'include/notifier.php', 'tgroup', $item_id);
+       proc_run(array('priority' => PRIORITY_HIGH, 'dont_fork' => true), 'include/notifier.php', 'tgroup', $item_id);
 
 }
 
@@ -2076,7 +2076,7 @@ function item_expire($uid, $days, $network = "", $force = false) {
                drop_item($item['id'], false);
        }
 
-       proc_run(PRIORITY_LOW, "include/notifier.php", "expire", $uid);
+       proc_run(array('priority' => PRIORITY_LOW, 'dont_fork' => true), "include/notifier.php", "expire", $uid);
 
 }
 
@@ -2099,7 +2099,7 @@ function drop_items($items) {
        // multiple threads may have been deleted, send an expire notification
 
        if ($uid) {
-               proc_run(PRIORITY_LOW, "include/notifier.php", "expire", $uid);
+               proc_run(array('priority' => PRIORITY_LOW, 'dont_fork' => true), "include/notifier.php", "expire", $uid);
        }
 }
 
@@ -2124,6 +2124,10 @@ function drop_item($id, $interactive = true) {
 
        $item = $r[0];
 
+       if ($item['deleted']) {
+               return 0;
+       }
+
        $owner = $item['uid'];
 
        $contact_id = 0;
@@ -2295,7 +2299,7 @@ function drop_item($id, $interactive = true) {
                $drop_id = intval($item['id']);
                $priority = ($interactive ? PRIORITY_HIGH : PRIORITY_LOW);
 
-               proc_run($priority, "include/notifier.php", "drop", $drop_id);
+               proc_run(array('priority' => $priority, 'dont_fork' => true), "include/notifier.php", "drop", $drop_id);
 
                if (! $interactive) {
                        return $owner;