Skip to content

Commit 93dd69b

Browse files
committed
store: Wait for the db to be up in set_manifest_raw_yaml
1 parent 44c1674 commit 93dd69b

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

store/postgres/src/deployment_store.rs

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1844,12 +1844,23 @@ impl DeploymentStore {
18441844
}
18451845

18461846
pub(crate) async fn set_manifest_raw_yaml(
1847-
&self,
1847+
self: Arc<Self>,
18481848
site: Arc<Site>,
18491849
raw_yaml: String,
18501850
) -> Result<(), StoreError> {
1851-
self.with_conn(move |conn, _| {
1852-
deployment::set_manifest_raw_yaml(conn, &site, &raw_yaml).map_err(Into::into)
1851+
let logger = self.logger.cheap_clone();
1852+
retry::forever_async(&logger, "set_manifest_raw_yaml", move || {
1853+
let site = site.cheap_clone();
1854+
let raw_yaml = raw_yaml.clone();
1855+
let store = self.cheap_clone();
1856+
async move {
1857+
store
1858+
.with_conn(move |conn, _| {
1859+
deployment::set_manifest_raw_yaml(conn, &site, &raw_yaml)
1860+
.map_err(Into::into)
1861+
})
1862+
.await
1863+
}
18531864
})
18541865
.await
18551866
}

store/postgres/src/subgraph_store.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1615,7 +1615,10 @@ impl SubgraphStoreTrait for SubgraphStore {
16151615
raw_yaml: String,
16161616
) -> Result<(), StoreError> {
16171617
let (store, site) = self.store(hash)?;
1618-
store.set_manifest_raw_yaml(site, raw_yaml).await
1618+
store
1619+
.cheap_clone()
1620+
.set_manifest_raw_yaml(site, raw_yaml)
1621+
.await
16191622
}
16201623

16211624
fn instrument(&self, deployment: &DeploymentLocator) -> Result<bool, StoreError> {

0 commit comments

Comments
 (0)