File tree Expand file tree Collapse file tree 4 files changed +16
-5
lines changed
graph/src/components/store Expand file tree Collapse file tree 4 files changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -527,7 +527,7 @@ where
527
527
let store = & self . inputs . store ;
528
528
if !ENV_VARS . disable_fail_fast && !store. is_deployment_synced ( ) {
529
529
store
530
- . unassign_subgraph ( )
530
+ . pause_subgraph ( )
531
531
. map_err ( |e| ProcessingError :: Unknown ( e. into ( ) ) ) ?;
532
532
533
533
// Use `Canceled` to avoiding setting the subgraph health to failed, an error was
Original file line number Diff line number Diff line change @@ -395,7 +395,7 @@ pub trait WritableStore: ReadStore + DeploymentCursorTracker {
395
395
/// Cheap, cached operation.
396
396
fn is_deployment_synced ( & self ) -> bool ;
397
397
398
- fn unassign_subgraph ( & self ) -> Result < ( ) , StoreError > ;
398
+ fn pause_subgraph ( & self ) -> Result < ( ) , StoreError > ;
399
399
400
400
/// Load the dynamic data sources for the given deployment
401
401
async fn load_dynamic_data_sources (
Original file line number Diff line number Diff line change @@ -358,6 +358,17 @@ impl SyncStore {
358
358
} )
359
359
}
360
360
361
+ fn pause_subgraph ( & self , site : & Site ) -> Result < ( ) , StoreError > {
362
+ retry:: forever ( & self . logger , "unassign_subgraph" , || {
363
+ let mut pconn = self . store . primary_conn ( ) ?;
364
+ pconn. transaction ( |conn| -> Result < _ , StoreError > {
365
+ let mut pconn = primary:: Connection :: new ( conn) ;
366
+ let changes = pconn. pause_subgraph ( site) ?;
367
+ self . store . send_store_event ( & StoreEvent :: new ( changes) )
368
+ } )
369
+ } )
370
+ }
371
+
361
372
async fn load_dynamic_data_sources (
362
373
& self ,
363
374
block : BlockNumber ,
@@ -1722,8 +1733,8 @@ impl WritableStoreTrait for WritableStore {
1722
1733
self . is_deployment_synced . load ( Ordering :: SeqCst )
1723
1734
}
1724
1735
1725
- fn unassign_subgraph ( & self ) -> Result < ( ) , StoreError > {
1726
- self . store . unassign_subgraph ( & self . store . site )
1736
+ fn pause_subgraph ( & self ) -> Result < ( ) , StoreError > {
1737
+ self . store . pause_subgraph ( & self . store . site )
1727
1738
}
1728
1739
1729
1740
async fn load_dynamic_data_sources (
Original file line number Diff line number Diff line change @@ -141,7 +141,7 @@ impl WritableStore for MockStore {
141
141
unimplemented ! ( )
142
142
}
143
143
144
- fn unassign_subgraph ( & self ) -> Result < ( ) , StoreError > {
144
+ fn pause_subgraph ( & self ) -> Result < ( ) , StoreError > {
145
145
unimplemented ! ( )
146
146
}
147
147
You can’t perform that action at this time.
0 commit comments