Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix configuration does not take effect in real time #334

Merged
merged 2 commits into from Aug 6, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -15,6 +15,7 @@
- [#325](https://github.com/hyperf-cloud/hyperf/pull/325) Fixed consul service check the same service registration status more than one times.
- [#332](https://github.com/hyperf-cloud/hyperf/pull/332) Fixed type error in `Hyperf\Tracer\Middleware\TraceMiddeware`.
- [#333](https://github.com/hyperf-cloud/hyperf/pull/333) Fixed Function Redis::delete() is deprecated.
- [#334](https://github.com/hyperf-cloud/hyperf/pull/334) Fixed configuration of aliyun acm is not work expected.

# v1.0.9 - 2019-08-03

Expand Down
7 changes: 1 addition & 6 deletions src/config-aliyun-acm/src/Process/ConfigFetcherProcess.php
Expand Up @@ -68,15 +68,10 @@ public function handle(): void
while (true) {
$config = $this->client->pull();
if ($config !== $this->cacheConfig) {
if ($this->cacheConfig !== null) {
$diff = array_diff($this->cacheConfig ?? [], $config);
} else {
$diff = $config;
}
$this->cacheConfig = $config;
$workerCount = $this->server->setting['worker_num'] + $this->server->setting['task_worker_num'] - 1;
for ($workerId = 0; $workerId <= $workerCount; ++$workerId) {
$this->server->sendMessage(new PipeMessage($diff), $workerId);
$this->server->sendMessage(new PipeMessage($config), $workerId);
}
}
sleep($this->config->get('aliyun_acm.interval', 5));
Expand Down