Use stopwatch for more accurate measurements and reduce log spam

DateTime.Now is suitible for small timespans
Replaced the needlessly complex and verbose logging for the httpserver
This commit is contained in:
Bond_009
2019-02-25 18:26:17 +01:00
parent b3438559cc
commit 0f9006c81f
4 changed files with 27 additions and 122 deletions

View File

@@ -44,7 +44,7 @@ namespace Emby.Server.Implementations.ScheduledTasks
var dueTime = triggerDate - now;
logger.LogInformation("Daily trigger for {0} set to fire at {1}, which is {2} minutes from now.", taskName, triggerDate.ToString(), dueTime.TotalMinutes.ToString(CultureInfo.InvariantCulture));
logger.LogInformation("Daily trigger for {0} set to fire at {1}, which is {2} minutes from now.", taskName, triggerDate, dueTime);
Timer = new Timer(state => OnTriggered(), null, dueTime, TimeSpan.FromMilliseconds(-1));
}