Browse Source

Don't fork worker on frontend by default

tags/2019.09
Michael Vogel 2 months ago
parent
commit
35a487ae30
2 changed files with 3 additions and 2 deletions
  1. 1
    1
      mod/item.php
  2. 2
    1
      src/Core/Worker.php

+ 1
- 1
mod/item.php View File

@@ -835,7 +835,7 @@ function item_post(App $a) {
835 835
 	// When we are doing some forum posting via ! we have to start the notifier manually.
836 836
 	// These kind of posts don't initiate the notifier call in the item class.
837 837
 	if ($only_to_forum) {
838
-		Worker::add(PRIORITY_HIGH, "Notifier", Delivery::POST, $post_id);
838
+		Worker::add(['priority' => PRIORITY_HIGH, 'dont_fork' => false], "Notifier", Delivery::POST, $post_id);
839 839
 	}
840 840
 
841 841
 	Logger::log('post_complete');

+ 2
- 1
src/Core/Worker.php View File

@@ -1125,7 +1125,8 @@ class Worker
1125 1125
 		}
1126 1126
 
1127 1127
 		$priority = PRIORITY_MEDIUM;
1128
-		$dont_fork = Config::get("system", "worker_dont_fork", false);
1128
+		// Don't fork from frontend tasks by default
1129
+		$dont_fork = Config::get("system", "worker_dont_fork", false) || !\get_app()->isBackend();
1129 1130
 		$created = DateTimeFormat::utcNow();
1130 1131
 		$force_priority = false;
1131 1132
 

Loading…
Cancel
Save