Skip to content

Commit

Permalink
Address coderabbit feedback
Browse files Browse the repository at this point in the history
Signed-off-by: Dave Thaler <dthaler1968@gmail.com>
  • Loading branch information
dthaler committed Dec 21, 2024
1 parent 811ff88 commit 8677db8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
13 changes: 8 additions & 5 deletions OrcanodeMonitor/Core/Fetcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -738,8 +738,13 @@ public static long DateTimeToUnixTimeStamp(DateTime dateTime)

public class TimestampResult
{
public string UnixTimestampString = string.Empty;
public DateTimeOffset? Offset = null;
public string UnixTimestampString { get; }
public DateTimeOffset? Offset { get; }
public TimestampResult(string unixTimestampString, DateTimeOffset? offset)
{
UnixTimestampString = unixTimestampString;
Offset = offset;
}
}

public async static Task<TimestampResult?> GetLatestS3TimestampAsync(Orcanode node, bool updateNode, ILogger logger)
Expand Down Expand Up @@ -777,9 +782,7 @@ public class TimestampResult

string content = await response.Content.ReadAsStringAsync();
string unixTimestampString = content.TrimEnd();
var result = new TimestampResult();
result.UnixTimestampString = unixTimestampString;
result.Offset = response.Content.Headers.LastModified;
var result = new TimestampResult(unixTimestampString, response.Content.Headers.LastModified);
return result;
}

Expand Down
1 change: 1 addition & 0 deletions OrcanodeMonitor/Pages/SpectralDensity.cshtml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ private async Task UpdateFrequencyDataAsync()
Orcanode? node = _databaseContext.Orcanodes.Where(n => n.ID == _nodeId).FirstOrDefault();
if (node == null)
{
_logger.LogWarning("Node not found with ID: {NodeId}", _nodeId);
return;
}
TimestampResult? result = await GetLatestS3TimestampAsync(node, false, _logger);
Expand Down

0 comments on commit 8677db8

Please sign in to comment.