mirror of
https://github.com/euzu/tuliprox.git
synced 2026-10-04 15:02:16 +02: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}")));
|
||||
}
|
||||
|
||||
@@ -109,9 +109,9 @@ pub async fn playlist_resolve_vod(app_config: &AppConfig, client: &reqwest::Clie
|
||||
processed_info_ids.insert(provider_id, ts);
|
||||
content_updated = true;
|
||||
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}")));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user