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

bens: decrease offchain cache and trigger resolution during address page #1155

Open
sevenzing opened this issue Dec 16, 2024 · 0 comments
Open
Labels
enhancement New feature or request
Milestone

Comments

@sevenzing
Copy link
Contributor

  • descrease offchain cache from 4 hours to 15 minutes:

time = 14400, // 4 * 60 * 60 seconds = 4 hours

  • trigger offchain resolution during /address/:

pub async fn handle_user_domain_names(
&self,
db: &PgPool,
from_user: &DomainNameOnProtocol<'_>,
) -> Result<(), anyhow::Error> {
let protocol = from_user.deployed_protocol.protocol;
let level = from_user.inner.level();
let range = 2..=MAX_LEVEL;
let level_is_fine = range.contains(&level);
if protocol.info.protocol_specific.try_offchain_resolve() && level_is_fine {
let _lock = self.offchain_mutex.lock().await;
offchain_resolve(db, from_user).await?
};
Ok(())
}

lol, rename handle_user_domain_names to handle_user_domain_name please

@sevenzing sevenzing assigned lok52 and unassigned lok52 Dec 16, 2024
@sevenzing sevenzing added the enhancement New feature or request label Dec 16, 2024
@sevenzing sevenzing added this to the BENS v1 milestone Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants