Skip to content

Commit

Permalink
fixed newestdatapoint file access if there are sorted and unsorted fi…
Browse files Browse the repository at this point in the history
…les (_ before #)
  • Loading branch information
andreaskellermann committed Oct 5, 2024
1 parent b097dc5 commit 6692ba1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion FKala.Core/DataLayer/DataLayer_Readable_Caching_V1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ namespace FKala.Core
{
public class DataLayer_Readable_Caching_V1 : IDataLayer, IDisposable
{
private readonly int FilenameDatePatternLength = "yyyy.MM.dd.dat".Length;
public int ReadBuffer { get; } = 131072;
public int WriteBuffer { get; } = 131072;

Expand Down Expand Up @@ -105,7 +106,7 @@ public List<int> LoadAvailableYears(string measurement)
{
var month = int.Parse(Path.GetFileName(monthDir));

foreach (var file in Directory.GetFiles(monthDir, $"{measurementSubPath}*.dat").OrderDescending())
foreach (var file in Directory.GetFiles(monthDir, $"{measurementSubPath}*.dat").OrderByDescending(fn => fn.Substring(fn.Length - FilenameDatePatternLength)))
{
var lastLine = LastLineReader.ReadLastLine(file);
if (string.IsNullOrEmpty(lastLine))
Expand Down

0 comments on commit 6692ba1

Please sign in to comment.