GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — `cargo lambda invoke` while `cargo lambda watch --bin <name>` · Issue #876 · cargo-lambda/cargo-lambda Open DescriptionI have a scenario where I have one lambda which calls another lambda. To emulate this locally, I have a debug assertion that invoke instead of invoking the lambda on AWS: pub async fn invoke_deferred_task(payload: DeferredTaskPayload) { let payload = serde_json::to_string(&payload).unwrap(); // Invoke a lambda to finish the work #[cfg(debug_assertions)] { let root_dir = std::path::Path::new(env!("CARGO_MANIFEST_DIR")); #[expect(clippy::zombie_processes)] std::process::Command::new("cargo") .args([ "lambda", "invoke", "deferred_lambda", "--data-ascii", &payload, ]) .current_dir(root_dir) .spawn() .expect("Failed to invoke lambda in debug mode"); } #[cfg(not(debug_assertions))] { let config = aws_config::load_defaults(aws_config::BehaviorVersion::latest()).await; let lambda_client = aws_sdk_lambda::Client::new(&config); let deferred_lambda_name = std::env::var("DEFERRED_LAMBDA_NAME").expect("missing DEFERRED_LAMBDA_NAME"); lambda_client .invoke() .invocation_type(aws_sdk_lambda::types::InvocationType::Event) .function_name(deferred_lambda_name) .payload(aws_sdk_lambda::primitives::Blob::new(payload)) .send() .await .expect("Failed to invoke lambda in production mode"); } } This works quite well, but when I add Im not sure why, but it seems to add the watched bin to the args, so we get two --bins: Activity
MetadataMetadataAssigneesLabelsNo labels TypeProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |