Skip to content

Commit

Permalink
update deps
Browse files Browse the repository at this point in the history
  • Loading branch information
withinboredom committed Nov 8, 2023
1 parent 8565cf0 commit 37c6d99
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions .idea/durable-php.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .idea/php.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"amphp/log": "v2.0.0",
"amphp/parallel": "^v2",
"bottledcode/php-rql": "dev-master",
"crell/serde": "^0.6.0",
"crell/serde": "^1.0",
"nesbot/carbon": "^2.66",
"php": ">=8.2",
"ramsey/uuid": "^4.7.4",
Expand Down
2 changes: 1 addition & 1 deletion src/Logger.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public static function always(string $message, ...$vars): void
...
[basename($caller['file'], '.php'), ...$vars]
);
$logger->alert($output, ['e/s' => number_format(self::$counter / self::$elapsed, 2), 'est' => number_format((self::$counter / self::$elapsed) * 3, 2)]);
$logger->alert($output);
}

public static function error(string $message, ...$vars): void
Expand Down
7 changes: 5 additions & 2 deletions src/State/EntityHistory.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
use Bottledcode\DurablePhp\Events\WithOrchestration;
use Bottledcode\DurablePhp\Exceptions\Unwind;
use Bottledcode\DurablePhp\MonotonicClock;
use Bottledcode\DurablePhp\Proxy\SpyProxy;
use Bottledcode\DurablePhp\State\Ids\StateId;
use Crell\Serde\Attributes\Field;
use Generator;
Expand Down Expand Up @@ -171,7 +172,7 @@ private function execute(Event $original, string $operation, array $input): Gene

$context = new EntityContext(
$this->id->toEntityId(), $operation, $input, $this->state, $this, $taskDispatcher, $replyTo,
$original->eventId
$original->eventId, new SpyProxy()
);

if (is_object($this->state)) {
Expand Down Expand Up @@ -222,7 +223,9 @@ private function finalize(Event $event): Generator
$now = time();
$cutoff = $now - 3600; // 1 hour
$this->history[$event->eventId] = $this->debugHistory ? $event : $now;
$this->history = array_filter($this->history, static fn(int|bool|Event $value) => is_int($value) ? $value > $cutoff : $value);
$this->history =
array_filter($this->history, static fn(int|bool|Event $value) => is_int($value) ? $value > $cutoff : $value
);
$this->status = $this->status->with(lastUpdated: MonotonicClock::current()->now());

yield null;
Expand Down

0 comments on commit 37c6d99

Please sign in to comment.