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: refresh addr on error #127

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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 packages/nacos-config/src/http_agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,13 +182,11 @@ export class HttpAgent {
case HTTP_NOT_FOUND:
return null;
case HTTP_CONFLICT:
await this.serverListMgr.updateCurrentServer(unit);
// JAVA 在外面业务类处理的这个逻辑,应该是需要重试的
lastErr = new Error(`[Client Worker] ${this.loggerDomain} server config being modified concurrently, data: ${JSON.stringify(data)}`);
lastErr.name = `${this.loggerDomain}ServerConflictError`;
break;
default:
await this.serverListMgr.updateCurrentServer(unit);
// JAVA 还有一个针对 HTTP_FORBIDDEN 的处理,不过合并到 default 应该也没问题
lastErr = new Error(`${this.loggerDomain} Server Error Status: ${res.status}, url: ${url}, data: ${JSON.stringify(data)}`);
lastErr.name = `${this.loggerDomain}ServerResponseError`;
Expand All @@ -205,6 +203,8 @@ export class HttpAgent {
lastErr = err;
}

await this.serverListMgr.updateCurrentServer(unit);

} while (Date.now() < endTime);

throw lastErr;
Expand Down