1
1
use std:: sync:: Arc ;
2
2
3
- use anyhow:: { Context , Result } ;
3
+ use anyhow:: Result ;
4
4
use graph:: prelude:: {
5
5
BlockPtr , DeploymentHash , NodeId , SubgraphRegistrarError , SubgraphStore as SubgraphStoreTrait ,
6
6
} ;
@@ -12,11 +12,6 @@ use graph::{
12
12
} ;
13
13
use graph_store_postgres:: SubgraphStore ;
14
14
15
- pub struct DevModeContext {
16
- pub watch : bool ,
17
- pub updates_rx : Receiver < ( DeploymentHash , SubgraphName ) > ,
18
- }
19
-
20
15
/// Cleanup a subgraph
21
16
/// This is used to remove a subgraph before redeploying it when using the watch flag
22
17
fn cleanup_dev_subgraph (
@@ -62,7 +57,7 @@ async fn deploy_subgraph(
62
57
} )
63
58
}
64
59
65
- pub async fn drop_and_recreate_subgraph (
60
+ async fn drop_and_recreate_subgraph (
66
61
logger : & Logger ,
67
62
subgraph_store : Arc < SubgraphStore > ,
68
63
subgraph_registrar : Arc < impl SubgraphRegistrar > ,
@@ -124,37 +119,3 @@ pub async fn watch_subgraph_updates(
124
119
error ! ( logger, "Subgraph watcher terminated unexpectedly" ; "action" => "exiting" ) ;
125
120
std:: process:: exit ( 1 ) ;
126
121
}
127
-
128
- /// Parse an alias string into a tuple of (alias_name, manifest, Option<build_dir>)
129
- pub fn parse_alias ( alias : & str ) -> anyhow:: Result < ( String , String , Option < String > ) > {
130
- let mut split = alias. split ( ':' ) ;
131
- let alias_name = split. next ( ) ;
132
- let alias_value = split. next ( ) ;
133
-
134
- if alias_name. is_none ( ) || alias_value. is_none ( ) || split. next ( ) . is_some ( ) {
135
- return Err ( anyhow:: anyhow!(
136
- "Invalid alias format: expected 'alias=[BUILD_DIR:]manifest', got '{}'" ,
137
- alias
138
- ) ) ;
139
- }
140
-
141
- let alias_name = alias_name. unwrap ( ) . to_owned ( ) ;
142
- let ( manifest, build_dir) = parse_manifest_arg ( alias_value. unwrap ( ) )
143
- . with_context ( || format ! ( "While parsing alias '{}'" , alias) ) ?;
144
-
145
- Ok ( ( alias_name, manifest, build_dir) )
146
- }
147
-
148
- /// Parse a manifest string into a tuple of (manifest, Option<build_dir>)
149
- pub fn parse_manifest_arg ( value : & str ) -> anyhow:: Result < ( String , Option < String > ) > {
150
- match value. split_once ( ':' ) {
151
- Some ( ( manifest, build_dir) ) if !manifest. is_empty ( ) => {
152
- Ok ( ( manifest. to_owned ( ) , Some ( build_dir. to_owned ( ) ) ) )
153
- }
154
- Some ( _) => Err ( anyhow:: anyhow!(
155
- "Invalid manifest arg: missing manifest in '{}'" ,
156
- value
157
- ) ) ,
158
- None => Ok ( ( value. to_owned ( ) , None ) ) ,
159
- }
160
- }
0 commit comments