mirror of
https://gitee.com/hyperf/hyperf.git
synced 2024-12-02 11:48:08 +08:00
Merge pull request #1085 from Reasno/retry
fix issue #1069 which breaks retry annotation
This commit is contained in:
commit
c88e5ca32b
@ -10,6 +10,7 @@
|
||||
## Fixed
|
||||
|
||||
- [#1049](https://github.com/hyperf/hyperf/pull/1049) Fixed `Hyperf\Cache\Driver\RedisDriver::clear` sometimes fails to delete all caches.
|
||||
- [#1085](https://github.com/hyperf/hyperf/pull/1085) Fixed broken retry annotation
|
||||
|
||||
## Optimized
|
||||
|
||||
|
@ -18,8 +18,10 @@ use Hyperf\Retry\Policy\ClassifierRetryPolicy;
|
||||
use Hyperf\Retry\Policy\FallbackRetryPolicy;
|
||||
use Hyperf\Retry\Policy\MaxAttemptsRetryPolicy;
|
||||
use Hyperf\Retry\Policy\SleepRetryPolicy;
|
||||
use Hyperf\Retry\RetryBudget;
|
||||
use Hyperf\Retry\RetryBudgetInterface;
|
||||
use Hyperf\Retry\SleepStrategyInterface;
|
||||
use Hyperf\Utils\ApplicationContext;
|
||||
|
||||
/**
|
||||
* @Annotation
|
||||
@ -117,7 +119,11 @@ class Retry extends AbstractRetry
|
||||
{
|
||||
parent::__construct($value);
|
||||
if (is_array($this->retryBudget)) {
|
||||
$this->retryBudget = make(RetryBudgetInterface::class, $this->retryBudget);
|
||||
if (ApplicationContext::hasContainer() && ApplicationContext::getContainer()->has(RetryBudgetInterface::class)){
|
||||
$this->retryBudget = make(RetryBudgetInterface::class, $this->retryBudget);
|
||||
} else {
|
||||
$this->retryBudget = make(RetryBudget::class, $this->retryBudget);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user