Skip to content

Commit

Permalink
periodically write to hits count file
Browse files Browse the repository at this point in the history
  • Loading branch information
tonerdo committed Apr 6, 2018
1 parent dedede7 commit 568c5dc
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/coverlet.core/CoverageTracker.cs
Expand Up @@ -25,13 +25,18 @@ public static void MarkExecuted(string path, string marker)
{
_markers.TryAdd(path, new List<string>());
_markers[path].Add(marker);
if (_markers[path].Count >= 100000)
{
File.AppendAllLines(path, _markers[path]);
_markers[path].Clear();
}
}
}

public static void CurrentDomain_ProcessExit(object sender, EventArgs e)
{
foreach (var kvp in _markers)
File.WriteAllLines(kvp.Key, kvp.Value);
File.AppendAllLines(kvp.Key, kvp.Value);
}
}
}

0 comments on commit 568c5dc

Please sign in to comment.