-
Notifications
You must be signed in to change notification settings - Fork 110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add concurrency option to control max concurrent writes to db #460
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -123,6 +123,7 @@ impl<'w> Cli { | |
uri: URI::try_from(cmd.from.as_str()) | ||
.with_context(|| format!("Parsing import URI '{}'", cmd.from))?, | ||
schema: cmd.schema, | ||
concurrency: 1, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've hardcoded import jobs to concurrency 1 since I think we only use a single db connection here, but let me know if it should also be exposed in the import command. |
||
} | ||
.try_into()?; | ||
|
||
|
@@ -176,6 +177,7 @@ impl<'w> Cli { | |
uri: URI::try_from(cmd.to.as_str()) | ||
.with_context(|| format!("Parsing generation URI '{}'", cmd.to))?, | ||
schema: cmd.schema, | ||
concurrency: cmd.concurrency, | ||
} | ||
.try_into()?; | ||
|
||
|
@@ -289,6 +291,13 @@ pub struct GenerateCommand { | |
)] | ||
#[serde(skip)] | ||
pub schema: Option<String>, | ||
#[structopt( | ||
long, | ||
help = "The maximum number of concurrent tasks writing to the database.", | ||
default_value = "3" | ||
)] | ||
#[serde(skip)] | ||
pub concurrency: usize, | ||
} | ||
|
||
#[derive(StructOpt, Serialize)] | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not really sure what this is used for and what the default concurrency should be here