MCPcopy Create free account
hub / github.com/chatmail/core / get_raw_config

Method get_raw_config

src/sql.rs:586–604  ·  view source on GitHub ↗

Get configuration options from the database.

(&self, key: &str)

Source from the content-addressed store, hash-verified

584
585 /// Get configuration options from the database.
586 pub async fn get_raw_config(&self, key: &str) -> Result<Option<String>> {
587 let lock = self.config_cache.read().await;
588 let cached = lock.get(key).cloned();
589 drop(lock);
590
591 if let Some(c) = cached {
592 return Ok(c);
593 }
594
595 let mut lock = self.config_cache.write().await;
596 let value = self
597 .query_get_value("SELECT value FROM config WHERE keyname=?", (key,))
598 .await
599 .context(format!("failed to fetch raw config: {key}"))?;
600 lock.insert(key.to_string(), value.clone());
601 drop(lock);
602
603 Ok(value)
604 }
605
606 /// Removes the `key`'s value from the cache.
607 pub(crate) async fn uncache_raw_config(&self, key: &str) {

Callers 12

poke_specFunction · 0.80
config_existsMethod · 0.80
get_config_optMethod · 0.80
get_ui_configMethod · 0.80
get_raw_config_intMethod · 0.80
get_raw_config_u32Method · 0.80
get_raw_config_int64Method · 0.80
get_asset_iconFunction · 0.80
get_infoMethod · 0.80
get_oauth2_access_tokenFunction · 0.80
runFunction · 0.80
migrate_socks_configMethod · 0.80

Calls 4

query_get_valueMethod · 0.80
insertMethod · 0.80
cloneMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected