Skip to content
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

cache relayAddrs for a short period of time #608

Merged
merged 1 commit into from
Apr 22, 2019

Conversation

vyzo
Copy link
Contributor

@vyzo vyzo commented Apr 22, 2019

relayAddrs is not the cheapest of methods and can be called potentially hundreds of times within a short period of time whenever there is a push.
This patch adds a bit of logic to cache the result for a short period of time, enough to cover a single push.

@vyzo vyzo requested a review from Stebalien April 22, 2019 16:50
@ghost ghost assigned vyzo Apr 22, 2019
@ghost ghost added the status/in-progress In progress label Apr 22, 2019
Copy link
Member

@Stebalien Stebalien left a comment

Choose a reason for hiding this comment

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

We may want to push this into the host and have the host cache addresses but this should work for now.

Actually, what if we just had the host run a background loop every 10 seconds handling PushIdentify and recalculating/caching these addresses?

@vyzo
Copy link
Contributor Author

vyzo commented Apr 22, 2019

It's a bit more invasive (and subtle change) that needs some thought, so let's start with the big offender.

@Stebalien Stebalien merged commit 48800a6 into master Apr 22, 2019
@ghost ghost removed the status/in-progress In progress label Apr 22, 2019
@Stebalien Stebalien deleted the feat/cache-relay-addrs branch April 22, 2019 17:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants