access, not write

This commit is contained in:
Stanley Dimant
2024-05-02 15:10:45 +02:00
parent adafc1dbcf
commit 7221ca0555

View File

@@ -112,9 +112,9 @@ public sealed class CachedFileProvider : IDisposable
{ {
_logger.LogDebug("Copying {hash} from cold storage: {path}", hash, coldStorageFilePath); _logger.LogDebug("Copying {hash} from cold storage: {path}", hash, coldStorageFilePath);
var tempFileName = destinationFilePath + ".dl"; var tempFileName = destinationFilePath + ".dl";
coldStorageFilePath.LastWriteTimeUtc = DateTime.UtcNow;
File.Copy(coldStorageFilePath.FullName, tempFileName, true); File.Copy(coldStorageFilePath.FullName, tempFileName, true);
File.Move(tempFileName, destinationFilePath, true); File.Move(tempFileName, destinationFilePath, true);
coldStorageFilePath.LastAccessTimeUtc = DateTime.UtcNow;
_metrics.IncGauge(MetricsAPI.GaugeFilesTotal); _metrics.IncGauge(MetricsAPI.GaugeFilesTotal);
_metrics.IncGauge(MetricsAPI.GaugeFilesTotalSize, new FileInfo(destinationFilePath).Length); _metrics.IncGauge(MetricsAPI.GaugeFilesTotalSize, new FileInfo(destinationFilePath).Length);
return true; return true;