Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions application/clicommands/ScheduleCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
use ipl\Scheduler\Contract\Task;
use ipl\Scheduler\Scheduler;
use React\EventLoop\Loop;
use React\Promise\ExtendedPromiseInterface;
use React\Promise\PromiseInterface;
use Throwable;

class ScheduleCommand extends Command
Expand Down Expand Up @@ -121,7 +121,7 @@ protected function attachJobsLogging(Scheduler $scheduler)
Logger::debug($e->getTraceAsString());
});

$scheduler->on(Scheduler::ON_TASK_RUN, function (Task $job, ExtendedPromiseInterface $_) {
$scheduler->on(Scheduler::ON_TASK_RUN, function (Task $job, PromiseInterface $_) {
Logger::info('Running job %s', $job->getName());
});

Expand Down
2 changes: 1 addition & 1 deletion library/Reporting/Actions/SendMail.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ function ($pdf) use ($mail, $name, $recipients) {
$mail->attachPdf($pdf, $name);
$mail->send(null, $recipients);
}
)->otherwise(function (Throwable $e) {
)->catch(function (Throwable $e) {
Logger::error($e);
Logger::debug($e->getTraceAsString());
});
Expand Down
11 changes: 4 additions & 7 deletions library/Reporting/Schedule.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
use Ramsey\Uuid\Uuid;
use React\EventLoop\Loop;
use React\Promise;
use React\Promise\ExtendedPromiseInterface;
use React\Promise\PromiseInterface;

use function md5;

Expand Down Expand Up @@ -128,7 +128,7 @@ public function getChecksum(): string
);
}

public function run(): ExtendedPromiseInterface
public function run(): PromiseInterface
{
$deferred = new Promise\Deferred();
Loop::futureTick(function () use ($deferred) {
Expand All @@ -144,12 +144,9 @@ public function run(): ExtendedPromiseInterface
return;
}

$deferred->resolve();
$deferred->resolve(null);
});

/** @var ExtendedPromiseInterface $promise */
$promise = $deferred->promise();

return $promise;
return $deferred->promise();
}
}
Loading