2
2
//! requests/replies and notifications back to the client.
3
3
use std:: {
4
4
env, fmt,
5
+ sync:: Arc ,
5
6
time:: { Duration , Instant } ,
6
7
} ;
7
8
@@ -229,17 +230,23 @@ impl GlobalState {
229
230
}
230
231
ProjectWorkspaceProgress :: End ( workspaces) => {
231
232
self . fetch_workspaces_completed ( workspaces) ;
233
+
234
+ let old = Arc :: clone ( & self . workspaces ) ;
232
235
self . switch_workspaces ( ) ;
233
- if self . config . run_build_scripts ( ) {
236
+ let workspaces_updated = !Arc :: ptr_eq ( & old, & self . workspaces ) ;
237
+
238
+ if self . config . run_build_scripts ( ) && workspaces_updated {
234
239
let mut collector = BuildDataCollector :: default ( ) ;
235
240
for ws in self . workspaces . iter ( ) {
236
241
ws. collect_build_data_configs ( & mut collector) ;
237
242
}
238
243
self . fetch_build_data_request ( collector)
239
244
}
245
+
240
246
( Progress :: End , None )
241
247
}
242
248
} ;
249
+
243
250
self . report_progress ( "fetching" , state, msg, None ) ;
244
251
}
245
252
Task :: FetchBuildData ( progress) => {
@@ -250,15 +257,19 @@ impl GlobalState {
250
257
}
251
258
BuildDataProgress :: End ( build_data_result) => {
252
259
self . fetch_build_data_completed ( build_data_result) ;
260
+
253
261
self . switch_workspaces ( ) ;
262
+
254
263
( Some ( Progress :: End ) , None )
255
264
}
256
265
} ;
266
+
257
267
if let Some ( state) = state {
258
268
self . report_progress ( "loading" , state, msg, None ) ;
259
269
}
260
270
}
261
271
}
272
+
262
273
// Coalesce multiple task events into one loop turn
263
274
task = match self . task_pool . receiver . try_recv ( ) {
264
275
Ok ( task) => task,
0 commit comments