mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-02-16 18:47:57 -05:00
Fix nullref in object timeout
This commit is contained in:
@@ -275,7 +275,9 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer
|
|||||||
CreateSessionTask = task;
|
CreateSessionTask = task;
|
||||||
Task.Run(async () =>
|
Task.Run(async () =>
|
||||||
{
|
{
|
||||||
ObjectExplorerTaskResult result = await RunTaskWithTimeout(task, settings.CreateSessionTimeout);
|
ObjectExplorerTaskResult result = await RunTaskWithTimeout(task,
|
||||||
|
settings?.CreateSessionTimeout ?? ObjectExplorerSettings.DefaultCreateSessionTimeout);
|
||||||
|
|
||||||
if (result != null && !result.IsComplete)
|
if (result != null && !result.IsComplete)
|
||||||
{
|
{
|
||||||
cancellationTokenSource.Cancel();
|
cancellationTokenSource.Cancel();
|
||||||
@@ -419,7 +421,9 @@ namespace Microsoft.SqlTools.ServiceLayer.ObjectExplorer
|
|||||||
ExpandTask = task;
|
ExpandTask = task;
|
||||||
Task.Run(async () =>
|
Task.Run(async () =>
|
||||||
{
|
{
|
||||||
ObjectExplorerTaskResult result = await RunTaskWithTimeout(task, settings.ExpandTimeout);
|
ObjectExplorerTaskResult result = await RunTaskWithTimeout(task,
|
||||||
|
settings?.ExpandTimeout ?? ObjectExplorerSettings.DefaultExpandTimeout);
|
||||||
|
|
||||||
if (result != null && !result.IsComplete)
|
if (result != null && !result.IsComplete)
|
||||||
{
|
{
|
||||||
cancellationTokenSource.Cancel();
|
cancellationTokenSource.Cancel();
|
||||||
|
|||||||
@@ -10,10 +10,13 @@ namespace Microsoft.SqlTools.ServiceLayer.SqlContext
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public class ObjectExplorerSettings
|
public class ObjectExplorerSettings
|
||||||
{
|
{
|
||||||
|
public static int DefaultCreateSessionTimeout = 10;
|
||||||
|
public static int DefaultExpandTimeout = 10;
|
||||||
|
|
||||||
public ObjectExplorerSettings()
|
public ObjectExplorerSettings()
|
||||||
{
|
{
|
||||||
CreateSessionTimeout = 10;
|
CreateSessionTimeout = DefaultCreateSessionTimeout;
|
||||||
ExpandTimeout = 10;
|
ExpandTimeout = DefaultExpandTimeout;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user