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

fix(crons): Don't panic when passing --auth-token #2172

Merged
merged 1 commit into from
Oct 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/commands/monitors/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ use sentry::protocol::{MonitorCheckIn, MonitorCheckInStatus, MonitorConfig, Moni

use crate::api::envelopes_api::EnvelopesApi;
use crate::utils::system::QuietExit;
use crate::utils::value_parsers::auth_token_parser;

pub fn make_command(command: Command) -> Command {
command
Expand Down Expand Up @@ -96,7 +97,12 @@ pub fn make_command(command: Command) -> Command {
),
)
// Hide auth token from --help output
.arg(Arg::new("auth_token").long("auth-token").hide(true))
.arg(
Arg::new("auth_token")
.long("auth-token")
.value_parser(auth_token_parser)
.hide(true),
)
}

fn run_program(args: Vec<&String>, monitor_slug: &str) -> (bool, Option<i32>, Duration) {
Expand Down Expand Up @@ -140,7 +146,7 @@ fn execute_checkin(
};

let envelopes_api = EnvelopesApi::try_new()?;

if let Err(e) = envelopes_api.send_envelope(open_checkin) {
log::error!("Failed to send in-progress check-in envelope: {e}");
log::info!("Continuing to run program...");
Expand Down
Loading