Skip to content

Commit

Permalink
Move storage init to set storage method
Browse files Browse the repository at this point in the history
  • Loading branch information
stfndamjanovic committed Jan 27, 2024
1 parent c4e9deb commit 1a8cdd6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/CircuitBreaker.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ private function __construct(string $name)
*/
public function call(\Closure $action, ...$args)
{
$this->storage->init($this);

$stateHandler = $this->makeStateHandler();

return $stateHandler->call($action, $args);
Expand Down Expand Up @@ -209,6 +207,8 @@ public function skipFailureCount(\Closure $closure)
public function storage(CircuitBreakerStorage $storage)
{
$this->storage = $storage;

$this->storage->init($this);

return $this;
}
Expand Down

0 comments on commit 1a8cdd6

Please sign in to comment.