@@ -815,7 +815,10 @@ pub async fn exists_and_synced(conn: &mut PgConnection, id: &str) -> Result<bool
815815}
816816
817817// Does nothing if the error already exists. Returns the error id.
818- fn insert_subgraph_error ( conn : & mut PgConnection , error : & SubgraphError ) -> anyhow:: Result < String > {
818+ async fn insert_subgraph_error (
819+ conn : & mut PgConnection ,
820+ error : & SubgraphError ,
821+ ) -> anyhow:: Result < String > {
819822 use subgraph_error as e;
820823
821824 let error_id = hex:: encode ( stable_hash_legacy:: utils:: stable_hash :: < SetHasher , _ > (
@@ -850,12 +853,12 @@ fn insert_subgraph_error(conn: &mut PgConnection, error: &SubgraphError) -> anyh
850853 Ok ( error_id)
851854}
852855
853- pub fn fail (
856+ pub async fn fail (
854857 conn : & mut PgConnection ,
855858 id : & DeploymentHash ,
856859 error : & SubgraphError ,
857860) -> Result < ( ) , StoreError > {
858- let error_id = insert_subgraph_error ( conn, error) ?;
861+ let error_id = insert_subgraph_error ( conn, error) . await ?;
859862
860863 update_deployment_status ( conn, id, SubgraphHealth :: Failed , Some ( error_id) , None ) ?;
861864
@@ -926,7 +929,7 @@ pub fn update_deployment_status(
926929/// unhealthy. The `latest_block` is only used to check whether the subgraph
927930/// is healthy as of that block; errors are inserted according to the
928931/// `block_ptr` they contain
929- pub ( crate ) fn insert_subgraph_errors (
932+ pub ( crate ) async fn insert_subgraph_errors (
930933 logger : & Logger ,
931934 conn : & mut PgConnection ,
932935 id : & DeploymentHash ,
@@ -941,7 +944,7 @@ pub(crate) fn insert_subgraph_errors(
941944 ) ;
942945
943946 for error in deterministic_errors {
944- insert_subgraph_error ( conn, error) ?;
947+ insert_subgraph_error ( conn, error) . await ?;
945948 }
946949
947950 check_health ( logger, conn, id, latest_block)
0 commit comments