-
Notifications
You must be signed in to change notification settings - Fork 15
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
add prefetch time in logic #131
Conversation
c328cb6
to
55d165f
Compare
src/providers/ecs_ram_role.ts
Outdated
import CredentialsProvider from '../credentials_provider' | ||
import { Request, doRequest } from './http' | ||
import Session from './session' | ||
import { parseUTC } from './time' | ||
import { Session, SessionCredentialProvider, SCALE_TIME } from './session' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
stale_time
src/providers/ecs_ram_role.ts
Outdated
this.roleName = builder.roleName; | ||
this.disableIMDSv1 = builder.disableIMDSv1; | ||
this.readTimeout = builder.readTimeout; | ||
this.connectTimeout = builder.connectTimeout; | ||
this.checker = this.checkCredentialsUpdateAynchronously(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
checkCredentialsUpdateAsynchronously
src/providers/ecs_ram_role.ts
Outdated
return setTimeout(async () => { | ||
await this.getCredentials(); | ||
this.checker = this.checkCredentialsUpdateAynchronously(); | ||
console.log(this.checker); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
console.log去掉
src/providers/ecs_ram_role.ts
Outdated
checkCredentialsUpdateAynchronously(): NodeJS.Timeout { | ||
return setTimeout(async () => { | ||
await this.getCredentials(); | ||
this.checker = this.checkCredentialsUpdateAynchronously(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
失败后会打断
getProviderName(): string { | ||
return 'ram_role_arn'; | ||
return `ram_role_arn/${this.credentialsProvider.getProviderName()}`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这种方式没有记录上上个Provider链路,仅记录了一层
src/providers/session.ts
Outdated
this.scaleTimestamp = now; | ||
} | ||
// 已过期,看缓存,缓存若大于15分钟,返回缓存,若小于15分钟,则根据策略判断是立刻重试还是稍后重试 | ||
if (now < this.scaleTimestamp) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这种方式没有区分缓存还是这次请求拿到的,this.scaleTimestamp已修改
94ba310
to
6f08be7
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #131 +/- ##
==========================================
- Coverage 98.00% 97.34% -0.66%
==========================================
Files 36 36
Lines 1201 1245 +44
Branches 206 214 +8
==========================================
+ Hits 1177 1212 +35
- Misses 12 18 +6
- Partials 12 15 +3 ☔ View full report in Codecov by Sentry. |
87ffe60
to
fc01f90
Compare
No description provided.