Skip to content

Commit f03de22

Browse files
committed
refactor(aggregator): remove Vacuum task from database cleaning operations
1 parent 53e6d45 commit f03de22

File tree

1 file changed

+7
-15
lines changed

1 file changed

+7
-15
lines changed

mithril-aggregator/src/services/upkeep.rs

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,7 @@ impl AggregatorUpkeepService {
101101
info!(db_upkeep_logger, "Cleaning main database");
102102
SqliteCleaner::new(&main_db_connection)
103103
.with_logger(db_upkeep_logger.clone())
104-
.with_tasks(&[
105-
SqliteCleaningTask::Vacuum,
106-
SqliteCleaningTask::WalCheckpointTruncate,
107-
])
104+
.with_tasks(&[SqliteCleaningTask::WalCheckpointTruncate])
108105
.run()?;
109106

110107
info!(db_upkeep_logger, "Cleaning cardano transactions database");
@@ -218,18 +215,18 @@ mod tests {
218215

219216
let logs = std::fs::read_to_string(&log_path).unwrap();
220217

221-
assert_eq!(
222-
logs.matches(SqliteCleaningTask::Vacuum.log_message())
223-
.count(),
224-
1,
225-
"Should have run only once since only the main database has a `Vacuum` cleanup"
226-
);
227218
assert_eq!(
228219
logs.matches(SqliteCleaningTask::WalCheckpointTruncate.log_message())
229220
.count(),
230221
3,
231222
"Should have run three times since the three databases have a `WalCheckpointTruncate` cleanup"
232223
);
224+
assert_eq!(
225+
logs.matches(SqliteCleaningTask::Vacuum.log_message())
226+
.count(),
227+
0,
228+
"Upkeep operation should not include Vacuum tasks"
229+
);
233230
}
234231

235232
#[tokio::test]
@@ -257,11 +254,6 @@ mod tests {
257254

258255
let logs = std::fs::read_to_string(&log_path).unwrap();
259256

260-
assert_eq!(
261-
logs.matches(SqliteCleaningTask::Vacuum.log_message())
262-
.count(),
263-
0,
264-
);
265257
assert_eq!(
266258
logs.matches(SqliteCleaningTask::WalCheckpointTruncate.log_message())
267259
.count(),

0 commit comments

Comments
 (0)