mirror of
https://github.com/openai/codex.git
synced 2026-05-29 23:40:29 +00:00
Clarify remote installed cache build helpers
This commit is contained in:
@@ -898,7 +898,7 @@ impl PluginRequestProcessor {
|
||||
auth: Option<&CodexAuth>,
|
||||
) -> Vec<PluginMarketplaceEntry> {
|
||||
let remote_marketplaces = if let Some(remote_marketplaces) =
|
||||
plugins_manager.cached_remote_installed_plugin_marketplaces()
|
||||
plugins_manager.build_remote_installed_plugin_marketplaces_from_cache()
|
||||
{
|
||||
Ok(remote_marketplaces)
|
||||
} else {
|
||||
@@ -906,7 +906,7 @@ impl PluginRequestProcessor {
|
||||
chatgpt_base_url: config.chatgpt_base_url.clone(),
|
||||
};
|
||||
plugins_manager
|
||||
.fetch_remote_installed_plugin_marketplaces_with_cache(
|
||||
.build_and_cache_remote_installed_plugin_marketplaces(
|
||||
&remote_plugin_service_config,
|
||||
auth,
|
||||
)
|
||||
|
||||
@@ -604,7 +604,7 @@ impl PluginsManager {
|
||||
remote_installed_plugins_to_config(plugins, &self.store)
|
||||
}
|
||||
|
||||
pub fn cached_remote_installed_plugin_marketplaces(
|
||||
pub fn build_remote_installed_plugin_marketplaces_from_cache(
|
||||
&self,
|
||||
) -> Option<Vec<crate::remote::RemoteMarketplace>> {
|
||||
let cache = match self.remote_installed_plugins_cache.read() {
|
||||
@@ -615,7 +615,7 @@ impl PluginsManager {
|
||||
Some(crate::remote::group_remote_installed_plugins_by_marketplaces(plugins, &self.store))
|
||||
}
|
||||
|
||||
pub async fn fetch_remote_installed_plugin_marketplaces_with_cache(
|
||||
pub async fn build_and_cache_remote_installed_plugin_marketplaces(
|
||||
&self,
|
||||
config: &RemotePluginServiceConfig,
|
||||
auth: Option<&CodexAuth>,
|
||||
|
||||
@@ -399,7 +399,7 @@ remote_plugin = true
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn cached_remote_installed_plugin_marketplaces_read_bundle_metadata() {
|
||||
fn build_remote_installed_plugin_marketplaces_from_cache_reads_bundle_metadata() {
|
||||
let codex_home = TempDir::new().unwrap();
|
||||
let plugin_base = codex_home
|
||||
.path()
|
||||
@@ -430,7 +430,7 @@ fn cached_remote_installed_plugin_marketplaces_read_bundle_metadata() {
|
||||
}]);
|
||||
|
||||
let marketplaces = manager
|
||||
.cached_remote_installed_plugin_marketplaces()
|
||||
.build_remote_installed_plugin_marketplaces_from_cache()
|
||||
.expect("remote installed cache should be present");
|
||||
assert_eq!(marketplaces.len(), 1);
|
||||
assert_eq!(marketplaces[0].name, "chatgpt-global");
|
||||
|
||||
Reference in New Issue
Block a user