Skip to content

Commit 3464722

Browse files
committed
store: Retry find_site when getting a writable store
1 parent 8c0d771 commit 3464722

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

store/postgres/src/subgraph_store.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ use crate::{
4444
index::{IndexList, Method},
4545
Layout,
4646
},
47+
retry,
4748
writable::{SourceableStore, WritableStore},
4849
NotificationSender,
4950
};
@@ -290,8 +291,11 @@ impl SubgraphStore {
290291

291292
// Ideally the lower level functions would be asyncified.
292293
let this = self.clone();
294+
let logger2 = logger.cheap_clone();
293295
let site = graph::spawn_blocking_allow_panic(move || -> Result<_, StoreError> {
294-
this.find_site(deployment)
296+
retry::forever(&logger2, "get_or_create_writable_store", || {
297+
this.find_site(deployment)
298+
})
295299
})
296300
.await
297301
.unwrap()?; // Propagate panics, there shouldn't be any.

0 commit comments

Comments
 (0)