Skip to content

Commit

Permalink
Logs now show date time rather than x hours ago
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-j-green committed Oct 18, 2023
1 parent ac97652 commit c5a1fd9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
23 changes: 15 additions & 8 deletions gaseous-server/Classes/Metadata/Storage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -457,18 +457,25 @@ private static void StoreRelations(string PrimaryTable, string SecondaryTable, l

private static void CacheClean()
{
if (ObjectCache == null)
try
{
ObjectCache = new Dictionary<string, MemoryCacheObject>();
}
Dictionary<string, MemoryCacheObject> workCache = ObjectCache;
foreach (KeyValuePair<string, MemoryCacheObject> objectCache in workCache)
{
if (objectCache.Value.ExpiryTime < DateTime.UtcNow)
if (ObjectCache == null)
{
ObjectCache = new Dictionary<string, MemoryCacheObject>();
}
Dictionary<string, MemoryCacheObject> workCache = ObjectCache;
foreach (KeyValuePair<string, MemoryCacheObject> objectCache in workCache)
{
ObjectCache.Remove(objectCache.Key);
if (objectCache.Value.ExpiryTime < DateTime.UtcNow)
{
ObjectCache.Remove(objectCache.Key);
}
}
}
catch
{
ObjectCache = new Dictionary<string, MemoryCacheObject>();
}
}

private class MemoryCacheObject
Expand Down
2 changes: 1 addition & 1 deletion gaseous-server/wwwroot/pages/settings/logs.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ <h1 id="gametitle_label">Logs</h1>

var newRow = [
//result[i].id,
moment(result[i].eventTime).fromNow(),
moment(result[i].eventTime).format("YYYY-MM-DD H:mm:ss"),
result[i].eventType,
result[i].process,
result[i].message
Expand Down

0 comments on commit c5a1fd9

Please sign in to comment.