Skip to content

Commit 2a57355

Browse files
captbaritonefacebook-github-bot
authored andcommitted
Back out "Disable persisted queries in validate mode"
Reviewed By: evanyeung Differential Revision: D79317297 fbshipit-source-id: a320ca4e45ebce11f37a1d342f03f31fad3c6683
1 parent b7c43a2 commit 2a57355

File tree

1 file changed

+15
-20
lines changed
  • compiler/crates/relay-bin/src

1 file changed

+15
-20
lines changed

compiler/crates/relay-bin/src/main.rs

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -314,28 +314,23 @@ async fn handle_compiler_command(command: CompileCommand) -> Result<(), Error> {
314314

315315
if command.validate {
316316
config.artifact_writer = Box::<ArtifactValidationWriter>::default();
317-
// Disable persister and persisted queries in validate mode
318-
config.create_operation_persister = None;
319-
for project_config in config.projects.values_mut() {
320-
project_config.persist = None;
321-
}
322-
} else {
323-
config.create_operation_persister = Some(Box::new(|project_config| {
324-
project_config.persist.as_ref().map(
325-
|persist_config| -> Box<dyn OperationPersister + Send + Sync> {
326-
match persist_config {
327-
PersistConfig::Remote(remote_config) => {
328-
Box::new(RemotePersister::new(remote_config.clone()))
329-
}
330-
PersistConfig::Local(local_config) => {
331-
Box::new(LocalPersister::new(local_config.clone()))
332-
}
333-
}
334-
},
335-
)
336-
}));
337317
}
338318

319+
config.create_operation_persister = Some(Box::new(|project_config| {
320+
project_config.persist.as_ref().map(
321+
|persist_config| -> Box<dyn OperationPersister + Send + Sync> {
322+
match persist_config {
323+
PersistConfig::Remote(remote_config) => {
324+
Box::new(RemotePersister::new(remote_config.clone()))
325+
}
326+
PersistConfig::Local(local_config) => {
327+
Box::new(LocalPersister::new(local_config.clone()))
328+
}
329+
}
330+
},
331+
)
332+
}));
333+
339334
config.file_source_config = if should_use_watchman() {
340335
FileSourceKind::Watchman
341336
} else {

0 commit comments

Comments
 (0)