mirror of
https://github.com/euzu/tuliprox.git
synced 2026-10-27 09:12:35 +01:00
write operations optimized for less memory usage
This commit is contained in:
@@ -96,7 +96,8 @@ async fn playlist_resolve_series_info(cfg: &AppConfig, client: &reqwest::Client,
|
||||
write_counter += 1;
|
||||
|
||||
// periodic flush to bound BufWriter memory
|
||||
if write_counter.is_multiple_of(FLUSH_INTERVAL) {
|
||||
if write_counter >= FLUSH_INTERVAL {
|
||||
write_counter = 0;
|
||||
if let Err(err) = content_writer.flush() {
|
||||
errors.push(notify_err!(format!("Failed periodic flush of wal content writer {err}")));
|
||||
}
|
||||
@@ -202,7 +203,8 @@ async fn process_series_info(
|
||||
}
|
||||
write_counter +=1;
|
||||
// periodic flush to bound BufWriter memory
|
||||
if write_counter.is_multiple_of(FLUSH_INTERVAL) {
|
||||
if write_counter <= FLUSH_INTERVAL {
|
||||
write_counter = 0;
|
||||
if let Err(err) = wal_writer.flush() {
|
||||
errors.push(notify_err!(format!("Failed periodic flush of wal content writer {err}")));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user