File tree Expand file tree Collapse file tree
library/Notifications/Daemon Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2222use React \EventLoop \Loop ;
2323use React \EventLoop \LoopInterface ;
2424
25- use function Clue \ React \Block \await ;
26- use function React \Promise \ Timer \ sleep ;
25+ use function React \Async \await ;
26+ use function React \Async \ delay ;
2727
2828class Daemon extends EventEmitter
2929{
@@ -323,8 +323,8 @@ protected function run(): void
323323
324324 $ endMs = (int ) (microtime (true ) * 1000 );
325325 if (($ endMs - $ beginMs ) < 3000 ) {
326- // run took less than 3 seconds; sleep for the remaining duration to prevent heavy db loads
327- await (sleep ((3000 - ($ endMs - $ beginMs )) / 1000 ));
326+ // run took less than 3 seconds; delay for the remaining duration to prevent heavy db loads
327+ await (delay ((3000 - ($ endMs - $ beginMs )) / 1000 ));
328328 }
329329 }
330330 self ::$ logger ::debug (self ::PREFIX . "cancellation triggered; exiting loop " );
You can’t perform that action at this time.
0 commit comments