Skip to content

chore: debounce polling of session info#675

Merged
theborakompanioni merged 2 commits intomasterfrom
chore/intervals
Oct 12, 2023
Merged

chore: debounce polling of session info#675
theborakompanioni merged 2 commits intomasterfrom
chore/intervals

Conversation

@theborakompanioni
Copy link
Collaborator

@theborakompanioni theborakompanioni commented Oct 10, 2023

Before these changes, the /session endpoint has been polled with setInterval - i.e. rescheduled to run every 10 seconds, regardless of the response duration. On slow connection, e.g. over Tor, this can lead to requests queuing up.

After this commit, a new request is made 10 seconds after the previous response arrived, which mitigates the behaviour described above.

..by using setIntervalDebounced instead of setInterval
@theborakompanioni theborakompanioni added performance Performance and/or speed improvements refactoring Code refactoring without functional changes labels Oct 10, 2023
@theborakompanioni theborakompanioni self-assigned this Oct 10, 2023
@theborakompanioni theborakompanioni marked this pull request as ready for review October 11, 2023 09:44
Copy link

@editwentyone editwentyone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tACK

@theborakompanioni theborakompanioni merged commit c1d6bdf into master Oct 12, 2023
@theborakompanioni theborakompanioni deleted the chore/intervals branch October 12, 2023 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

performance Performance and/or speed improvements refactoring Code refactoring without functional changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants