Skip to content

Commit e19687d

Browse files
author
Simon Ejsing
committed
Gracefully handle IOException on concurrent cache writes
1 parent 2e3d5e5 commit e19687d

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/GitVersionCore/ExecuteCore.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ namespace GitVersion
22
{
33
using System;
44
using System.ComponentModel;
5+
using System.IO;
56
using System.Linq;
67
using GitVersion.Helpers;
78

@@ -57,7 +58,14 @@ public VersionVariables ExecuteGitVersion(string targetUrl, string dynamicReposi
5758
if (versionVariables == null)
5859
{
5960
versionVariables = ExecuteInternal(targetBranch, commitId, repo, gitPreparer, projectRoot, buildServer, overrideConfig: overrideConfig);
60-
gitVersionCache.WriteVariablesToDiskCache(repo, dotGitDirectory, versionVariables);
61+
try
62+
{
63+
gitVersionCache.WriteVariablesToDiskCache(repo, dotGitDirectory, versionVariables);
64+
}
65+
catch (IOException)
66+
{
67+
Logger.WriteInfo("I/O exception during cache write");
68+
}
6169
}
6270

6371
return versionVariables;

0 commit comments

Comments
 (0)