mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-02-16 18:47:57 -05:00
Add a delay to avoid race condition for generate script to new Azure db (#1629)
This commit is contained in:
@@ -3,6 +3,7 @@
|
|||||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||||
//
|
//
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
using System.Threading;
|
||||||
using Microsoft.SqlServer.Dac;
|
using Microsoft.SqlServer.Dac;
|
||||||
using Microsoft.SqlTools.ServiceLayer.Connection;
|
using Microsoft.SqlTools.ServiceLayer.Connection;
|
||||||
using Microsoft.SqlTools.ServiceLayer.DacFx.Contracts;
|
using Microsoft.SqlTools.ServiceLayer.DacFx.Contracts;
|
||||||
@@ -51,6 +52,9 @@ namespace Microsoft.SqlTools.ServiceLayer.DacFx
|
|||||||
this.SqlTask.AddScript(SqlTaskStatus.Succeeded, Result.DatabaseScript);
|
this.SqlTask.AddScript(SqlTaskStatus.Succeeded, Result.DatabaseScript);
|
||||||
if (!string.IsNullOrEmpty(this.Result.MasterDbScript))
|
if (!string.IsNullOrEmpty(this.Result.MasterDbScript))
|
||||||
{
|
{
|
||||||
|
// Delay to avoid race condition to ensure both scripts get opened in ADS. Fix for https://github.com/microsoft/azuredatastudio/issues/20133
|
||||||
|
Thread.Sleep(500);
|
||||||
|
|
||||||
// master script is only used if the target is Azure SQL db and the script contains all operations that must be done against the master database
|
// master script is only used if the target is Azure SQL db and the script contains all operations that must be done against the master database
|
||||||
this.SqlTask.AddScript(SqlTaskStatus.Succeeded, this.Result.MasterDbScript);
|
this.SqlTask.AddScript(SqlTaskStatus.Succeeded, this.Result.MasterDbScript);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user