Skip to content

Commit

Permalink
Merge pull request #96 from tmknight/develop
Browse files Browse the repository at this point in the history
v0.13.1
  • Loading branch information
tmknight authored Mar 12, 2024
2 parents a12cb20 + d69acf8 commit 3fe556a
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).

## [Unreleased]

## 0.13.1

### Changed

- Streamline persistent log write which should resolve occasional conjoined entries

## 0.13.0

### Changed
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "docker-autoheal"
version = "0.13.0"
version = "0.13.1"
authors = ["Travis M Knight"]
license = "GPL-3.0"
description = "A cross-platform tool to monitor and remediate unhealthy Docker containers"
Expand Down
5 changes: 3 additions & 2 deletions src/report/record.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ pub async fn read_record() -> Result<Vec<JsonRecord>, Error> {
pub async fn write_record(data: JsonRecord) -> Result<(), Error> {
let log_file = LOG_PATH.to_owned() + LOG_FILE;
// Serialize the data to JSON
let json_data = serde_json::to_string(&data)?;
let mut json_data = serde_json::to_string(&data)?;
// Append newline to the JSON data
json_data.push('\n');
// Asynchronously open file for writing
let mut file = File::options()
.append(true)
Expand All @@ -46,7 +48,6 @@ pub async fn write_record(data: JsonRecord) -> Result<(), Error> {
.await?;
// Write the JSON data to file
file.write_all(json_data.as_bytes()).await?;
file.write_all(b"\n").await?;
file.flush().await?;
Ok(())
}

0 comments on commit 3fe556a

Please sign in to comment.