Skip to content
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

Feature: Timeout Parameter #203

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

cole-brown
Copy link

This does 2 things:

  1. Add a --timeout parameter to BaseCommand.
  2. Implement the timeout parameter for importing data during schemazen create.

This is not a complete timeout for everything, but it is a solution for #62 import timeout issues, which I also had and needed to fix.

#193 implements a timeout for schemazen script, which this does not do. Thank you to @rhumborl for giving me enough code in the diffs to make figuring out this patch much quicker.

Add the action CLI option to BaseCommand.

Parse input as integer with default of 30 (which seems to be what all
the SQL classes default to for their timeout).
Pass Console's `TimeoutSec` to Model's `TimeoutSec`.

Pass Command's `TimeoutSec` into Model.Database object as well as the
SqlConnectionStringBuilder.
  - Giving the timeout to only the Connection string isn't enough to
    allow for variable timeouts. Some SQL classes ignore that timeout,
    apparenly.
Pass timeout down again into `Table.ImportData()` so that the import can
set a timeout on its `SqlBulkCopy` object.
  - This is what actually allows for extended timeouts on `schemazen
  create [...]` commands.
Add timeout param for `Table.ImportData` unit tests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant