Skip to content

Commit

Permalink
update tig-worker
Browse files Browse the repository at this point in the history
  • Loading branch information
germ3n committed Jan 19, 2025
1 parent b39a379 commit e78679a
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion tig-worker/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,27 @@ fn compute_batch(
.output()?;

if !output.status.success() {
continue;
if output.status.code() == Some(87) {
let mut rt_sig = 0;
let stdout = String::from_utf8_lossy(&output.stdout);
let mut lines = stdout.lines().rev();
while let Some(line) = lines.next() {
if line.starts_with("Runtime signature: ") {
if let Some(sig) = line.strip_prefix("Runtime signature: ") {
if let Ok(sig) = sig.trim().parse::<u64>() {
rt_sig = sig;
break;
}
}
}
}

println!("Ran out of fuel, runtime signature: {}", rt_sig);

continue;
}

return Err(anyhow!("Native wrapper failed: {}", String::from_utf8_lossy(&output.stderr)));
}

let output_str = String::from_utf8_lossy(&output.stdout);
Expand Down

0 comments on commit e78679a

Please sign in to comment.