Compare commits
2 Commits
8e6950270e
...
df5776e76d
Author | SHA1 | Date |
---|---|---|
Ian Wijma | df5776e76d | |
Ian Wijma | 563938e51a |
|
@ -18,9 +18,19 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@master
|
- uses: actions/checkout@master
|
||||||
- name: Compile and release
|
- name: Compile and release
|
||||||
|
id: compile
|
||||||
uses: rust-build/rust-build.action@v1.4.4
|
uses: rust-build/rust-build.action@v1.4.4
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
with:
|
with:
|
||||||
RUSTTARGET: ${{ matrix.target }}
|
RUSTTARGET: ${{ matrix.target }}
|
||||||
ARCHIVE_TYPES: ${{ matrix.archive }}
|
ARCHIVE_TYPES: ${{ matrix.archive }}
|
||||||
|
UPLOAD_MODE: 'none'
|
||||||
|
- name: Upload artifact
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: Binary
|
||||||
|
path: |
|
||||||
|
${{ steps.compile.outputs.BUILT_ARCHIVE }}
|
||||||
|
${{ steps.compile.outputs.BUILT_CHECKSUM }}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "kr"
|
name = "kr"
|
||||||
version = "1.0.0"
|
version = "1.0.1"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
|
@ -84,7 +84,7 @@ fn check_history(retry: &Retry) -> bool {
|
||||||
return retry.history.len().lt(&usize::from(retry.max_retries))
|
return retry.history.len().lt(&usize::from(retry.max_retries))
|
||||||
}
|
}
|
||||||
|
|
||||||
fn spawn_process(retry: &Retry) -> std::io::Result<Child> {
|
fn spawn_process(retry: &Retry) -> Result<Child, std::io::Error> {
|
||||||
let mut command_parts: Vec<String> = retry
|
let mut command_parts: Vec<String> = retry
|
||||||
.command
|
.command
|
||||||
.split_whitespace()
|
.split_whitespace()
|
||||||
|
@ -95,7 +95,10 @@ fn spawn_process(retry: &Retry) -> std::io::Result<Child> {
|
||||||
command_parts.remove(0);
|
command_parts.remove(0);
|
||||||
command.args(command_parts);
|
command.args(command_parts);
|
||||||
|
|
||||||
return command.spawn();
|
match command.spawn() {
|
||||||
|
Ok(child) => Ok(child),
|
||||||
|
Err(err) => Err(err),
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn run_command(retry: &mut Retry) {
|
fn run_command(retry: &mut Retry) {
|
||||||
|
@ -120,7 +123,7 @@ fn run_command(retry: &mut Retry) {
|
||||||
println!("Restarting...");
|
println!("Restarting...");
|
||||||
restart(retry);
|
restart(retry);
|
||||||
} else {
|
} else {
|
||||||
print!("The process has crashed more then {} times in the past {}, stop restarting\n", retry.max_retries, retry.restart_name);
|
println!("The process has crashed more than {} times in the past {}, stop restarting\n", retry.max_retries, retry.restart_name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue