helper: always uptime xmrig uptime in update_from_output()

This commit is contained in:
hinto.janai 2024-01-22 14:22:36 -05:00
parent 5699fe6702
commit 364429ca68
No known key found for this signature in database
GPG key ID: D47CE05FA175A499
2 changed files with 6 additions and 3 deletions

2
Cargo.lock generated
View file

@ -2018,7 +2018,7 @@ dependencies = [
[[package]]
name = "gupax"
version = "1.3.3"
version = "1.3.4"
dependencies = [
"anyhow",
"arti-client",

View file

@ -1930,9 +1930,12 @@ impl PubXmrigApi {
) {
// 1. Take the process's current output buffer and combine it with Pub (if not empty)
let mut output_pub = lock!(output_pub);
if !output_pub.is_empty() {
{
let mut public = lock!(public);
public.output.push_str(&std::mem::take(&mut *output_pub));
if !output_pub.is_empty() {
public.output.push_str(&std::mem::take(&mut *output_pub));
}
// Update uptime
public.uptime = HumanTime::into_human(elapsed);
}