Don't fork worker on frontend by default
authorMichael Vogel <icarus@dabo.de>
Thu, 8 Aug 2019 20:42:12 +0000 (22:42 +0200)
committerMichael Vogel <icarus@dabo.de>
Thu, 8 Aug 2019 20:42:12 +0000 (22:42 +0200)
mod/item.php
src/Core/Worker.php

index ac5b11c..51bbc76 100644 (file)
@@ -835,7 +835,7 @@ function item_post(App $a) {
        // When we are doing some forum posting via ! we have to start the notifier manually.
        // These kind of posts don't initiate the notifier call in the item class.
        if ($only_to_forum) {
-               Worker::add(PRIORITY_HIGH, "Notifier", Delivery::POST, $post_id);
+               Worker::add(['priority' => PRIORITY_HIGH, 'dont_fork' => false], "Notifier", Delivery::POST, $post_id);
        }
 
        Logger::log('post_complete');
index 225a928..236f8b4 100644 (file)
@@ -1125,7 +1125,8 @@ class Worker
                }
 
                $priority = PRIORITY_MEDIUM;
-               $dont_fork = Config::get("system", "worker_dont_fork", false);
+               // Don't fork from frontend tasks by default
+               $dont_fork = Config::get("system", "worker_dont_fork", false) || !\get_app()->isBackend();
                $created = DateTimeFormat::utcNow();
                $force_priority = false;