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 \delay ;
2726
2827class Daemon extends EventEmitter
2928{
@@ -323,8 +322,8 @@ protected function run(): void
323322
324323 $ endMs = (int ) (microtime (true ) * 1000 );
325324 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 ) );
325+ // run took less than 3 seconds; delay for the remaining duration to prevent heavy db loads
326+ delay (( 3000 - ($ endMs - $ beginMs )) / 1000 );
328327 }
329328 }
330329 self ::$ logger ::debug (self ::PREFIX . "cancellation triggered; exiting loop " );
You can’t perform that action at this time.
0 commit comments