44
55use Exception ;
66use Throwable ;
7- use Utopia \Console ;
87use Utopia \Servers \Hook ;
98use Utopia \Telemetry \Adapter as Telemetry ;
109use Utopia \Telemetry \Adapter \None as NoTelemetry ;
@@ -267,7 +266,6 @@ public function start(): self
267266 {
268267 try {
269268 $ this ->adapter ->workerStart (function (string $ workerId ) {
270- Console::success ("[Worker] Worker {$ workerId } started. " );
271269 self ::setResource ('workerId ' , fn () => $ workerId );
272270
273271 foreach ($ this ->workerStartHooks as $ hook ) {
@@ -278,9 +276,6 @@ public function start(): self
278276 $ this ->adapter ->queue ,
279277 function (Message $ message ) {
280278 $ receivedAtTimestamp = microtime (true );
281- Console::info (
282- "[Job] Received Job ( {$ message ->getPid ()}). " ,
283- );
284279 try {
285280 $ waitDuration =
286281 microtime (true ) - $ message ->getTimestamp ();
@@ -353,18 +348,8 @@ function (Message $message) {
353348 }
354349 }
355350 }
356- Console::success (
357- "[Job] ( {$ message ->getPid ()}) successfully run. " ,
358- );
359351 },
360352 function (?Message $ message , Throwable $ th ) {
361- Console::error (
362- "[Job] ( {$ message ?->getPid()}) failed to run. " ,
363- );
364- Console::error (
365- "[Job] ( {$ message ?->getPid()}) {$ th ->getMessage ()}" ,
366- );
367-
368353 self ::setResource ('error ' , fn () => $ th );
369354
370355 foreach ($ this ->errorHooks as $ hook ) {
@@ -383,17 +368,11 @@ function (?Message $message, Throwable $th) {
383368 try {
384369 $ hook ->getAction ()(...$ this ->getArguments ($ hook ));
385370 } catch (Throwable $ e ) {
386- Console::error (
387- "[Worker] Worker {$ workerId } workerStop hook failed: {$ e ->getMessage ()}" ,
388- );
389371 }
390372 }
391373 } finally {
392374 // Always close consumer connection, even if hooks throw
393375 $ this ->adapter ->consumer ->close ();
394- Console::success (
395- "[Worker] Worker {$ workerId } stopped. " ,
396- );
397376 }
398377 });
399378
0 commit comments