Skip to content

Commit

Permalink
Merge branch 'main' into better-line-endings
Browse files Browse the repository at this point in the history
  • Loading branch information
snoyberg authored Jun 19, 2024
2 parents cb87d36 + 554b5fd commit 32ccd49
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# health-check
A health check executable that checks for common server failure modes

A health check executable that checks for common server failure modes.
4 changes: 3 additions & 1 deletion examples/sleep-check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ impl Cli {
fn run(&self) {
loop {
if self.stdout_print {
println!("Printing to stdout");
for _ in 1..50 {
println!("Printing to stdout");
}
}
eprintln!("Printing to stderr {}", self.output_timeout);
std::thread::sleep(Duration::from_secs(self.output_timeout.into()));
Expand Down
2 changes: 1 addition & 1 deletion src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ pub(crate) struct Cli {
#[arg(required = false)]
pub(crate) args: Vec<String>,
/// How many lines of output should we store for error messages?
#[arg(long, default_value_t = 10)]
#[arg(long, default_value_t = 50, env = "HEALTH_CHECK_OUTPUT_LINES")]
pub(crate) output_lines: usize,
}

Expand Down
15 changes: 9 additions & 6 deletions src/slack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,15 @@ impl SlackApp {
},
},
{
"type": "section",
"text": {
"type": "plain_text",
"text": latest_output,
}
},
"type": "divider"
}
],
"attachments": [
{
"mrkdwn_in": ["text"],
"author_name": "Logs",
"text": latest_output
}
]
});
if let Some(image_url) = &self.app_info.image_url {
Expand Down

0 comments on commit 32ccd49

Please sign in to comment.