Skip to content

A self-hosted media server and file management system

fix: ws events were broadcasted in instead of dispatched via queue, causing issues

aminnausinf30f173bc263
diff --git a/app/Services/TaskService.php b/app/Services/TaskService.php
index c87427dc..7e611e13 100644
--- a/app/Services/TaskService.php
+++ b/app/Services/TaskService.php
@@ -14,7 +14,7 @@ class TaskService {
$task = Task::create($attrs);
try {
- broadcast(new TaskUpdated($task->id));
+ TaskUpdated::dispatch($task->id);
} catch (\Throwable $th) {
dump($th->getMessage());
Log::error('Unable to broadcast task creation', ['error' => $th->getMessage()]);
@@ -44,9 +44,9 @@ class TaskService {
try {
if ($taskEnded) {
- broadcast(new TaskEnded($task->id));
+ TaskEnded::dispatch($task->id);
} else {
- broadcast(new TaskUpdated($task->id));
+ TaskUpdated::dispatch($task->id);
}
} catch (\Throwable $th) {
dump($th->getMessage());
@@ -72,7 +72,7 @@ class TaskService {
$subTask->save();
if ($broadcast) {
try {
- broadcast(new SubTaskUpdated($subTask->id, $subTask->task->id));
+ SubTaskUpdated::dispatch($subTask->id, $subTask->task->id);
} catch (\Throwable $th) {
dump($th->getMessage());
Log::error('Unable to broadcast subTask update', ['error' => $th->getMessage()]);
@@ -101,7 +101,7 @@ class TaskService {
$task->save();
if ($broadcast) {
try {
- broadcast(new TaskUpdated($task->id));
+ TaskUpdated::dispatch($task->id);
} catch (\Throwable $th) {
dump($th->getMessage());
Log::error('Unable to broadcast task count update', ['error' => $th->getMessage()]);