-
Notifications
You must be signed in to change notification settings - Fork 110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v0 fix self healing #114
v0 fix self healing #114
Conversation
} | ||
|
||
let (restart_sender, mut restart_receiver) = channel(10); | ||
let resource_monitor = | ||
ResourceMonitor::new(cli.self_healing, Duration::from_secs(60), 3, restart_sender); | ||
ResourceMonitor::new(cli.self_healing, Duration::from_secs(5), 3, restart_sender); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
todo set 60 back when merging
@@ -289,27 +275,6 @@ pub(crate) async fn stop_device( | |||
})) | |||
} | |||
|
|||
pub(crate) async fn start_recording( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unfortunately restart api was kinda broken, lets re-add once we have more traction on this feat
@@ -156,47 +162,39 @@ pub async fn continuous_capture( | |||
previous_image = Some(Arc::new(image.clone())); | |||
// debug!("ocr_task_running {} BEFORE if if !ocr_task_running.load(Ordering::SeqCst)", ocr_task_running.load(Ordering::SeqCst)); | |||
|
|||
if !ocr_task_running.load(Ordering::SeqCst) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fyi this atomic bool stuff was not necessary
it was used back in the day we did ocr on multi thread but here its just sequential, no need
ocr_task_running.store(true, Ordering::SeqCst); | ||
// debug!("ocr_task_running {}", ocr_task_running.load(Ordering::SeqCst)); | ||
let ocr_engine_clone = ocr_engine.clone(); | ||
tokio::spawn(async move { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also this thread spawn was not necessary at all?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no effect because we await inside
could have been useful if we didnt await the inside func maybe? i do that sometime in js but i think async here is slightly different
@@ -501,9 +462,6 @@ impl Server { | |||
.route("/audio/stop", post(stop_device)) | |||
.route("/audio/status", post(get_device_status)) | |||
.route("/audio/list", get(get_devices)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we could remove audio restart api too, just dead code atm until we ensure it work well
|
now the audio mic stopped working after like a minute: |
but when i run screenpipe from main branch, all works fine |
thats strange i never had such a good performance on my side been running for 16h now, <4s delay |
okay one of the issue new with this PR is that i feel like tesseract is duplicated in the background which leads to kind of memory leak and program get killed by OS at some point can solve it by properly stop tesseract upon reboot |
fix and implement a self-healing mode
why?
sometimes the frame or audio recording become stale after long time or on windows when computer sleep long enough or IDK
i'd rather make the code antifragile/redundant at high level first than spending decades digging into low parts
different ways to test this PR:
cargo build --release # add --features metal on mac ./target/release/screenpipe --self-healing
on my side it was working, but need to test deeper
PS: went kinda bulldozer removing lot of dead code, so would be nice to merge fast otherwise feel like this PR will die