-
Notifications
You must be signed in to change notification settings - Fork 65
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
perf(arns): cache resolution for non-existent name #208
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -596,15 +596,28 @@ export interface ValidNameResolution { | |||||||||||||||||||||||||||||||||
processId: string; | ||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||
// Name resolved, but is missing | ||||||||||||||||||||||||||||||||||
export interface MissingNameResolution { | ||||||||||||||||||||||||||||||||||
name: string; | ||||||||||||||||||||||||||||||||||
resolvedId: undefined; | ||||||||||||||||||||||||||||||||||
resolvedAt: number; | ||||||||||||||||||||||||||||||||||
ttl: number; | ||||||||||||||||||||||||||||||||||
processId: undefined; | ||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||
// An error occured while resolving the name | ||||||||||||||||||||||||||||||||||
export interface FailedNameResolution { | ||||||||||||||||||||||||||||||||||
name: string; | ||||||||||||||||||||||||||||||||||
resolvedId: undefined; | ||||||||||||||||||||||||||||||||||
resolvedAt: undefined; | ||||||||||||||||||||||||||||||||||
ttl: undefined; | ||||||||||||||||||||||||||||||||||
processId: undefined; | ||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||
Comment on lines
+608
to
615
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Correct typo in comment and use optional properties in
Here is the suggested diff: -// An error occured while resolving the name
+// An error occurred while resolving the name
export interface FailedNameResolution {
name: string;
- resolvedId: undefined;
- resolvedAt: undefined;
- ttl: undefined;
- processId: undefined;
+ resolvedId?: string;
+ resolvedAt?: number;
+ ttl?: number;
+ processId?: string;
} Committable suggestion
Suggested change
|
||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||
type NameResolution = ValidNameResolution | MissingNameResolution; | ||||||||||||||||||||||||||||||||||
type NameResolution = | ||||||||||||||||||||||||||||||||||
| ValidNameResolution | ||||||||||||||||||||||||||||||||||
| MissingNameResolution | ||||||||||||||||||||||||||||||||||
| FailedNameResolution; | ||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||
export interface NameResolver { | ||||||||||||||||||||||||||||||||||
resolve(name: string): Promise<NameResolution>; | ||||||||||||||||||||||||||||||||||
|
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.
Typo in comment and suggest using optional properties for better TypeScript practices
undefined
, consider making these properties optional using?
, which is more idiomatic in TypeScript.Apply this diff to correct the typo and update the interface:
Committable suggestion