Skip to content

Commit

Permalink
fix timeout for scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
rducom committed Jun 7, 2021
1 parent fe0b9ac commit 69631c5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/SqlBackupTools/GeneralCommandInfos.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ protected GeneralCommandInfos()
public bool Verbose { get; set; }

[Option("timeout", HelpText = "SQL Command timeout in seconds")]
public int Timeout { get; set; } = 90 * 60;
public int Timeout { get; set; } = 90 * 60; // 1h

[Option("logs", HelpText = "Log folder")]
public DirectoryInfo LogsPath { get; set; }
Expand Down Expand Up @@ -73,7 +73,7 @@ private SqlConnectionStringBuilder PrepareSqlConnectionStringBuilder(string data
DataSource = Hostname,
InitialCatalog = database,
ApplicationName = "SqlBackupTools",
ConnectTimeout = 30 * 60 // 30 min,
ConnectTimeout = Timeout
};
if (!String.IsNullOrWhiteSpace(Login) && !String.IsNullOrWhiteSpace(Password))
{
Expand Down
2 changes: 1 addition & 1 deletion src/SqlBackupTools/Restore/RestoreRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ private static async Task<Exception> PostScriptExecuteAsync(RestoreState state,
state.Loggger.Debug("Applying " + scripts.Count + " sql scripts");
foreach (var script in scripts)
{
await sqlConnection.ExecuteAsync(script, commandTimeout: 180);
await sqlConnection.ExecuteAsync(script, commandTimeout: state.RestoreCommand.Timeout);
}
}
catch (Exception e)
Expand Down

0 comments on commit 69631c5

Please sign in to comment.