Skip to content

Feature: Timeout Parameter#203

Open
cole-brown wants to merge 4 commits intosethreno:masterfrom
cole-brown:feature/timeout-parameter
Open

Feature: Timeout Parameter#203
cole-brown wants to merge 4 commits intosethreno:masterfrom
cole-brown:feature/timeout-parameter

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