Skip to content

Commit 6dd12c0

Browse files
committed
Replace usage of deprecated packages
- Clue\React\Block\await; - React\Promise\Timer\sleep;
1 parent 0e3587e commit 6dd12c0

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

library/Notifications/Daemon/Daemon.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
use React\EventLoop\Loop;
2323
use 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

2828
class 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");

0 commit comments

Comments
 (0)