Skip to content

Commit 2b22ec9

Browse files
committed
editoast: replace infra by infra_id in refresh_all
1 parent f701722 commit 2b22ec9

File tree

1 file changed

+18
-18
lines changed
  • editoast/src/generated_data

1 file changed

+18
-18
lines changed

editoast/src/generated_data/mod.rs

+18-18
Original file line numberDiff line numberDiff line change
@@ -86,39 +86,39 @@ pub trait GeneratedData {
8686
}
8787

8888
/// Refresh all the generated data of a given infra
89-
#[tracing::instrument(level = "debug", skip_all, fields(infra_id = infra))]
89+
#[tracing::instrument(level = "debug", skip_all, fields(infra_id))]
9090
pub async fn refresh_all(
9191
db_pool: Arc<DbConnectionPoolV2>,
92-
infra: i64,
92+
infra_id: i64,
9393
infra_cache: &InfraCache,
9494
) -> Result<()> {
9595
// The other layers depend on track section layer.
9696
// We must wait until its completion before running the other requests in parallel
97-
TrackSectionLayer::refresh_pool(db_pool.clone(), infra, infra_cache).await?;
98-
debug!("⚙️ Infra {infra}: track section layer is generated");
97+
TrackSectionLayer::refresh_pool(db_pool.clone(), infra_id, infra_cache).await?;
98+
debug!("⚙️ Infra {infra_id}: track section layer is generated");
9999
// The analyze step significantly improves the performance when importing and generating together
100100
// It doesn’t seem to make a different when the generation step is ran separately
101101
// It isn’t clear why without analyze the Postgres server seems to run at 100% without halting
102102
sql_query("analyze")
103103
.execute(db_pool.get().await?.deref_mut())
104104
.await?;
105-
debug!("⚙️ Infra {infra}: database analyzed");
105+
debug!("⚙️ Infra {infra_id}: database analyzed");
106106
futures::try_join!(
107-
SpeedSectionLayer::refresh_pool(db_pool.clone(), infra, infra_cache),
108-
SignalLayer::refresh_pool(db_pool.clone(), infra, infra_cache),
109-
SwitchLayer::refresh_pool(db_pool.clone(), infra, infra_cache),
110-
BufferStopLayer::refresh_pool(db_pool.clone(), infra, infra_cache),
111-
ElectrificationLayer::refresh_pool(db_pool.clone(), infra, infra_cache),
112-
DetectorLayer::refresh_pool(db_pool.clone(), infra, infra_cache),
113-
OperationalPointLayer::refresh_pool(db_pool.clone(), infra, infra_cache),
114-
PSLSignLayer::refresh_pool(db_pool.clone(), infra, infra_cache),
115-
NeutralSectionLayer::refresh_pool(db_pool.clone(), infra, infra_cache),
116-
NeutralSignLayer::refresh_pool(db_pool.clone(), infra, infra_cache),
107+
SpeedSectionLayer::refresh_pool(db_pool.clone(), infra_id, infra_cache),
108+
SignalLayer::refresh_pool(db_pool.clone(), infra_id, infra_cache),
109+
SwitchLayer::refresh_pool(db_pool.clone(), infra_id, infra_cache),
110+
BufferStopLayer::refresh_pool(db_pool.clone(), infra_id, infra_cache),
111+
ElectrificationLayer::refresh_pool(db_pool.clone(), infra_id, infra_cache),
112+
DetectorLayer::refresh_pool(db_pool.clone(), infra_id, infra_cache),
113+
OperationalPointLayer::refresh_pool(db_pool.clone(), infra_id, infra_cache),
114+
PSLSignLayer::refresh_pool(db_pool.clone(), infra_id, infra_cache),
115+
NeutralSectionLayer::refresh_pool(db_pool.clone(), infra_id, infra_cache),
116+
NeutralSignLayer::refresh_pool(db_pool.clone(), infra_id, infra_cache),
117117
)?;
118-
debug!("⚙️ Infra {infra}: object layers is generated");
118+
debug!("⚙️ Infra {infra_id}: object layers is generated");
119119
// The error layer depends on the other layers and must be executed at the end.
120-
ErrorLayer::refresh_pool(db_pool.clone(), infra, infra_cache).await?;
121-
debug!("⚙️ Infra {infra}: errors layer is generated");
120+
ErrorLayer::refresh_pool(db_pool.clone(), infra_id, infra_cache).await?;
121+
debug!("⚙️ Infra {infra_id}: errors layer is generated");
122122
Ok(())
123123
}
124124

0 commit comments

Comments
 (0)