-
-
Notifications
You must be signed in to change notification settings - Fork 223
Chore/poll timeout duration #5683
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
base: main
Are you sure you want to change the base?
Conversation
} from './utils/transaction'; | ||
import { generateActionId } from './utils/transaction'; | ||
import { getKey } from '../../polling-controller/src/AbstractPollingController'; |
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.
Import this using @metamask/polling-controller
rather than a relative import.
@@ -30,8 +30,18 @@ function StaticIntervalPollingControllerMixin< | |||
{ | |||
readonly #intervalIds: Record<PollingTokenSetId, NodeJS.Timeout> = {}; | |||
|
|||
#durationIds: Record<PollingTokenSetId, number> = {}; |
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.
Can we add a comment on what this is?
Also I think maybe the name can be more clear. Calling it durationIds
reads to me like the value of this key-value pair is an id
, but it's really the duration and the key is id
.
Maybe durationsById
#intervalLength: number | undefined = 1000; | ||
|
||
setKeyDuration(key: string, duration: number) { |
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.
setKeyDuration(key: string, duration: number) { | |
setDurationForId(id: string, duration: number) { |
Just to keep in line with the id
terminology of PollingTokenSetId
.
this.#durationIds[key] = duration; | ||
} | ||
|
||
getKeyDuration(key: string) { |
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.
getKeyDuration(key: string) { | |
getDurationForId(id: string) { |
Explanation
Added a time limit of 5 minutes to the bridge status controller
References
Changelog
Bridge status controller
Polling static intervals controller
Checklist