-
-
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
Open
GustavoRSSilva
wants to merge
11
commits into
main
Choose a base branch
from
chore/poll-timeout-duration
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+84
−27
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
3a17f05
chore: poll timeout
GustavoRSSilva c99ba1f
chore: bridge polling duration
GustavoRSSilva 1a4860e
chore: bridge polling duration
GustavoRSSilva 14fd97a
chore: bridge polling duration
GustavoRSSilva 28d3d06
chore: added changelog
GustavoRSSilva 37986a4
chore: merge main
GustavoRSSilva 16c7812
Update packages/bridge-status-controller/src/constants.ts
GustavoRSSilva e1f46f6
chore: pool limit
GustavoRSSilva 23d5f20
chore: pool limit
GustavoRSSilva 44bbf2d
chore: merge main
GustavoRSSilva ce5f465
chore: merge main
GustavoRSSilva File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -30,8 +30,18 @@ function StaticIntervalPollingControllerMixin< | |||||
{ | ||||||
readonly #intervalIds: Record<PollingTokenSetId, NodeJS.Timeout> = {}; | ||||||
|
||||||
#durationIds: Record<PollingTokenSetId, number> = {}; | ||||||
|
||||||
#intervalLength: number | undefined = 1000; | ||||||
|
||||||
setKeyDuration(key: string, duration: number) { | ||||||
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.
Suggested change
Just to keep in line with the |
||||||
this.#durationIds[key] = duration; | ||||||
} | ||||||
|
||||||
getKeyDuration(key: string) { | ||||||
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.
Suggested change
|
||||||
return this.#durationIds[key]; | ||||||
} | ||||||
|
||||||
setIntervalLength(intervalLength: number) { | ||||||
this.#intervalLength = intervalLength; | ||||||
} | ||||||
|
@@ -54,6 +64,12 @@ function StaticIntervalPollingControllerMixin< | |||||
// TODO: Either fix this lint violation or explain why it's necessary to ignore. | ||||||
// eslint-disable-next-line @typescript-eslint/no-misused-promises | ||||||
async () => { | ||||||
if (this.#durationIds[key] && Date.now() > this.#durationIds[key]) { | ||||||
this._stopPollingByPollingTokenSetId(key); | ||||||
delete this.#durationIds[key]; | ||||||
return; | ||||||
} | ||||||
|
||||||
try { | ||||||
await this._executePoll(input); | ||||||
} catch (error) { | ||||||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 anid
, but it's really the duration and the key isid
.Maybe
durationsById