Skip to content
This repository was archived by the owner on Dec 15, 2025. It is now read-only.

Commit 1b76c06

Browse files
committed
fixed formatting for gh action
1 parent f9f81d5 commit 1b76c06

File tree

2 files changed

+17
-13
lines changed

2 files changed

+17
-13
lines changed

src/app/rpc.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,11 @@ impl ZinitLoggingApiServer for Api {
412412
}
413413
});
414414
while let Some(log) = stream.next().await {
415-
if sink.send(serde_json::value::to_raw_value(&log)?).await.is_err() {
415+
if sink
416+
.send(serde_json::value::to_raw_value(&log)?)
417+
.await
418+
.is_err()
419+
{
416420
break;
417421
}
418422
}

src/zinit/lifecycle.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -328,33 +328,33 @@ impl LifecycleManager {
328328
async fn get_process_stats(&self, pid: i32) -> Result<(u64, f32)> {
329329
// Create a new System instance with all information
330330
let mut system = System::new_all();
331-
331+
332332
// Convert i32 pid to sysinfo::Pid
333333
let sys_pid = sysinfo::Pid::from(pid as usize);
334-
334+
335335
// Make sure we're refreshing CPU information
336336
system.refresh_cpu();
337337
system.refresh_processes();
338-
338+
339339
// First refresh to get initial CPU values
340340
system.refresh_all();
341-
341+
342342
// Wait longer for CPU measurement (500ms instead of 100ms)
343343
sleep(std::time::Duration::from_millis(500)).await;
344-
344+
345345
// Refresh again to get updated CPU values
346346
system.refresh_cpu();
347347
system.refresh_processes();
348348
system.refresh_all();
349-
349+
350350
// Get the process
351351
if let Some(process) = system.process(sys_pid) {
352352
// Get memory in bytes
353353
let memory_usage = process.memory();
354-
354+
355355
// Get CPU usage as percentage
356356
let cpu_usage = process.cpu_usage();
357-
357+
358358
Ok((memory_usage, cpu_usage))
359359
} else {
360360
// Process not found
@@ -366,18 +366,18 @@ impl LifecycleManager {
366366
async fn get_child_process_stats(&self, parent_pid: i32) -> Result<Vec<ProcessStats>> {
367367
// Create a new System instance with all processes information
368368
let mut system = System::new_all();
369-
369+
370370
// Make sure we're refreshing CPU information
371371
system.refresh_cpu();
372372
system.refresh_processes();
373373
system.refresh_all();
374-
374+
375375
// Convert i32 pid to sysinfo::Pid
376376
let sys_pid = sysinfo::Pid::from(parent_pid as usize);
377-
377+
378378
// Wait longer for CPU measurement (500ms instead of 100ms)
379379
sleep(std::time::Duration::from_millis(500)).await;
380-
380+
381381
// Refresh all system information to get updated CPU values
382382
system.refresh_cpu();
383383
system.refresh_processes();

0 commit comments

Comments
 (0)