Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions crates/tracedecay-sessions/src/runtime/hosts/pi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,10 @@ fn file_stamp(metadata: &std::fs::Metadata) -> PathFileStamp {
let (mtime_secs, inode) = {
use std::os::unix::fs::MetadataExt;
(
metadata.mtime().unsigned_abs().saturating_mul(1_000_000_000)
metadata
.mtime()
.unsigned_abs()
.saturating_mul(1_000_000_000)
+ metadata.mtime_nsec().unsigned_abs(),
metadata.ino(),
)
Expand Down Expand Up @@ -923,8 +926,12 @@ async fn admit_scheduled_file(
// re-enter admission, or every restart re-pays the whole corpus.
let stamp = {
let path_buf = path.to_path_buf();
run_blocking_transcript_section("pi", move || std::fs::metadata(&path_buf).ok().map(|meta| file_stamp(&meta)))
.await?
run_blocking_transcript_section("pi", move || {
std::fs::metadata(&path_buf)
.ok()
.map(|meta| file_stamp(&meta))
})
.await?
};
if let Some(stamp) = stamp {
if path_memo_matches(facade, scope, PI_COMPLETE_MEMO_PREFIX, path, stamp).await {
Expand Down
10 changes: 5 additions & 5 deletions crates/tracedecay/src/daemon/hook_v2_replay_consumer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,8 @@ struct PendingWorkRedriveState {
terminal: bool,
}

static PENDING_WORK_REDRIVE_GATE: std::sync::OnceLock<
std::sync::Mutex<PendingWorkRedriveGate>,
> = std::sync::OnceLock::new();
static PENDING_WORK_REDRIVE_GATE: std::sync::OnceLock<std::sync::Mutex<PendingWorkRedriveGate>> =
std::sync::OnceLock::new();

fn pending_work_redrive_gate() -> &'static std::sync::Mutex<PendingWorkRedriveGate> {
PENDING_WORK_REDRIVE_GATE
Expand Down Expand Up @@ -393,8 +392,9 @@ async fn redrive_pending_work(
);
}
} else {
state.next_eligible_micros =
now.0.saturating_add(pending_work_redrive_backoff(state.attempts));
state.next_eligible_micros = now
.0
.saturating_add(pending_work_redrive_backoff(state.attempts));
}
} else {
let mut gate = pending_work_redrive_gate()
Expand Down
Loading