Logs now show date time rather than x hours ago (#169)

This commit is contained in:
Michael Green
2023-10-18 23:00:35 +11:00
committed by GitHub
parent ac97652683
commit a4e5835e34
2 changed files with 17 additions and 10 deletions

View File

@@ -457,18 +457,25 @@ namespace gaseous_server.Classes.Metadata
private static void CacheClean()
{
if (ObjectCache == null)
try
{
if (ObjectCache == null)
{
ObjectCache = new Dictionary<string, MemoryCacheObject>();
}
Dictionary<string, MemoryCacheObject> workCache = ObjectCache;
foreach (KeyValuePair<string, MemoryCacheObject> objectCache in workCache)
{
if (objectCache.Value.ExpiryTime < DateTime.UtcNow)
{
ObjectCache.Remove(objectCache.Key);
}
}
}
catch
{
ObjectCache = new Dictionary<string, MemoryCacheObject>();
}
Dictionary<string, MemoryCacheObject> workCache = ObjectCache;
foreach (KeyValuePair<string, MemoryCacheObject> objectCache in workCache)
{
if (objectCache.Value.ExpiryTime < DateTime.UtcNow)
{
ObjectCache.Remove(objectCache.Key);
}
}
}
private class MemoryCacheObject

View File

@@ -54,7 +54,7 @@
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