Skip to content

Commit 5900822

Browse files
committed
Improve
1 parent 5dc8ad7 commit 5900822

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed

etl/src/store/both/postgres.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,8 @@ impl Inner {
174174
let snapshot_id = table_schema.snapshot_id;
175175

176176
// Insert the new schema
177-
self.table_schemas.insert((table_id, snapshot_id), table_schema);
177+
self.table_schemas
178+
.insert((table_id, snapshot_id), table_schema);
178179

179180
// Collect all snapshot_ids for this table
180181
let mut snapshots_for_table: Vec<SnapshotId> = self

etl/tests/postgres_store.rs

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -528,14 +528,20 @@ async fn test_schema_cache_eviction() {
528528
.map(|s| s.snapshot_id)
529529
.collect();
530530
assert!(table_1_snapshots.contains(&100) && table_1_snapshots.contains(&200));
531-
assert!(!table_1_snapshots.contains(&0), "Snapshot 0 should be evicted");
531+
assert!(
532+
!table_1_snapshots.contains(&0),
533+
"Snapshot 0 should be evicted"
534+
);
532535

533536
let table_2_snapshots: Vec<i64> = cached_schemas
534537
.iter()
535538
.filter(|s| s.id == table_id_2)
536539
.map(|s| s.snapshot_id)
537540
.collect();
538-
assert!(!table_2_snapshots.contains(&0), "Table 2 snapshot 0 should be evicted");
541+
assert!(
542+
!table_2_snapshots.contains(&0),
543+
"Table 2 snapshot 0 should be evicted"
544+
);
539545

540546
// Evicted schemas should still be loadable from DB
541547
let new_store = PostgresStore::new(pipeline_id, database.config.clone());
@@ -586,8 +592,14 @@ async fn test_multiple_pipelines_isolation() {
586592
let table_schema1 = create_sample_table_schema();
587593
let table_schema2 = create_another_table_schema();
588594

589-
store1.store_table_schema(table_schema1.clone()).await.unwrap();
590-
store2.store_table_schema(table_schema2.clone()).await.unwrap();
595+
store1
596+
.store_table_schema(table_schema1.clone())
597+
.await
598+
.unwrap();
599+
store2
600+
.store_table_schema(table_schema2.clone())
601+
.await
602+
.unwrap();
591603

592604
let schemas1 = store1.get_table_schemas().await.unwrap();
593605
assert_eq!(schemas1.len(), 1);

0 commit comments

Comments
 (0)