Skip to content

Commit 2a3aa88

Browse files
authored
Wait for project restore process to finish before starting with indexing (#27)
Hopefully Fixes #18 I think this could also be a problem when running the tool in "production"
1 parent e60d2a7 commit 2a3aa88

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

ScipDotnet/ScipIndexer.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ namespace ScipDotnet;
1313
/// </summary>
1414
public class ScipIndexer
1515
{
16+
private const int DotnetRestoreTimeout = 3000;
17+
1618
public ScipIndexer(ILogger<ScipIndexer> logger)
1719
{
1820
Logger = logger;
@@ -34,6 +36,7 @@ private static void Restore(IndexCommandOptions options, FileInfo project)
3436
};
3537
options.Logger.LogInformation("$ dotnet {Arguments}", arguments);
3638
process.Start();
39+
process.WaitForExit(DotnetRestoreTimeout);
3740
}
3841

3942
public async IAsyncEnumerable<Scip.Document> IndexDocuments(IHost host, IndexCommandOptions options)

0 commit comments

Comments
 (0)