@@ -86,39 +86,39 @@ pub trait GeneratedData {
86
86
}
87
87
88
88
/// 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) ) ]
90
90
pub async fn refresh_all (
91
91
db_pool : Arc < DbConnectionPoolV2 > ,
92
- infra : i64 ,
92
+ infra_id : i64 ,
93
93
infra_cache : & InfraCache ,
94
94
) -> Result < ( ) > {
95
95
// The other layers depend on track section layer.
96
96
// 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" ) ;
99
99
// The analyze step significantly improves the performance when importing and generating together
100
100
// It doesn’t seem to make a different when the generation step is ran separately
101
101
// It isn’t clear why without analyze the Postgres server seems to run at 100% without halting
102
102
sql_query ( "analyze" )
103
103
. execute ( db_pool. get ( ) . await ?. deref_mut ( ) )
104
104
. await ?;
105
- debug ! ( "⚙️ Infra {infra }: database analyzed" ) ;
105
+ debug ! ( "⚙️ Infra {infra_id }: database analyzed" ) ;
106
106
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) ,
117
117
) ?;
118
- debug ! ( "⚙️ Infra {infra }: object layers is generated" ) ;
118
+ debug ! ( "⚙️ Infra {infra_id }: object layers is generated" ) ;
119
119
// 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" ) ;
122
122
Ok ( ( ) )
123
123
}
124
124
0 commit comments