MCPcopy Index your code
hub / github.com/cargo-lambda/cargo-lambda / reload_env

Function reload_env

crates/cargo-lambda-watch/src/watcher.rs:264–292  ·  view source on GitHub ↗
(manifest_path: &PathBuf, bin_name: &Option<String>)

Source from the content-addressed store, hash-verified

262}
263
264fn reload_env(manifest_path: &PathBuf, bin_name: &Option<String>) -> HashMap<String, String> {
265 let metadata = match load_metadata(manifest_path, None) {
266 Ok(metadata) => metadata,
267 Err(e) => {
268 error!("failed to reload metadata: {}", e);
269 return HashMap::new();
270 }
271 };
272
273 let options = ConfigOptions {
274 names: FunctionNames::new(None, bin_name.clone()),
275 ..Default::default()
276 };
277 let config = match load_config_without_cli_flags(&metadata, &options) {
278 Ok(config) => config,
279 Err(e) => {
280 error!("failed to reload config: {}", e);
281 return HashMap::new();
282 }
283 };
284
285 match config.watch.lambda_environment(&config.env) {
286 Ok(env) => env,
287 Err(e) => {
288 error!("failed to reload environment: {}", e);
289 HashMap::new()
290 }
291 }
292}

Callers 1

runtimeFunction · 0.85

Calls 4

load_metadataFunction · 0.85
newFunction · 0.85
lambda_environmentMethod · 0.45

Tested by

no test coverage detected