This commit is contained in:
2020-06-15 18:52:15 +00:00
parent e58a59f730
commit 69030bd767
6 changed files with 51 additions and 66 deletions

View File

@@ -19,15 +19,20 @@ namespace AyaNova.Biz
{
private static ILogger log = AyaNova.Util.ApplicationLogging.CreateLogger("CoreJobLicense");
private static DateTime _lastCheck = DateTime.MinValue;
private static TimeSpan FAST_TRACK = new TimeSpan(0, 0, 30, 0);
#if (DEBUG)
private static TimeSpan FAST_TRACK = new TimeSpan(0, 1, 0);
private static TimeSpan SLOW_TRACK = new TimeSpan(0, 5, 0);
#else
private static TimeSpan FAST_TRACK = new TimeSpan(0, 30, 0);
private static TimeSpan SLOW_TRACK = new TimeSpan(24, 0, 0);
#endif
////////////////////////////////////////////////////////////////////////////////////////////////
// DoWork
//
public static async Task DoWorkAsync()
{
{
log.LogTrace("Job starting");
var tsSinceLastCheck = DateTime.UtcNow - _lastCheck;
//which track are we on?
@@ -71,7 +76,7 @@ namespace AyaNova.Biz
//Eventlog
await EventLogProcessor.LogEventToDatabaseAsync(new Event(1, 0, AyaType.License, AyaEvent.LicenseFetch, "FromCoreJob"), ct);
}
if(ret!="notfound")
if (ret != "notfound")
{
//I'm thinking do not log internally failed except as trace event as this would fill up log file
//instead if they have a license issue they can do manual fetch and then that will log so they can see error