Skip to content

Commit fc00a43

Browse files
authored
Delete trn, not tmp, in cleaning up (#42201)
1 parent 994d138 commit fc00a43

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/Cli/dotnet/Telemetry/PersistenceChannel/StorageService.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -321,18 +321,17 @@ private void CalculateSize()
321321
}
322322

323323
/// <summary>
324-
/// Enqueue is saving a transmission to a <c>tmp</c> file and after a successful write operation it renames it to a
324+
/// Enqueue is saving a transmission to a file with a guid, and after a successful write operation it renames it to a
325325
/// <c>trn</c> file.
326326
/// A file without a <c>trn</c> extension is ignored by Storage.Peek(), so if a process is taken down before rename
327-
/// happens
328-
/// it will stay on the disk forever.
329-
/// This thread deletes files with the <c>tmp</c> extension that exists on disk for more than 5 minutes.
327+
/// happens it will stay on the disk forever.
328+
/// This thread deletes files with the <c>trn</c> extension that exists on disk for more than 5 minutes.
330329
/// </summary>
331330
private void DeleteObsoleteFiles()
332331
{
333332
try
334333
{
335-
IEnumerable<string> files = GetFiles("*.tmp", 50);
334+
IEnumerable<string> files = GetFiles("*.trn", 50);
336335
foreach (string file in files)
337336
{
338337
DateTime creationTime = File.GetCreationTimeUtc(Path.Combine(StorageFolder, file));

0 commit comments

Comments
 (0)