This commit is contained in:
2021-07-30 15:26:32 +00:00
parent a1607e1568
commit 6da4108aca
5 changed files with 18 additions and 10 deletions

View File

@@ -720,8 +720,11 @@ namespace AyaNova.Biz
AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "GenerateBeforeInterval", await Translate("ErrorGenBeforeTooSmall"));
}
var tsRepeatInterval = dtRepeat - dtNow;
if (tsRepeatInterval.TotalSeconds < 3601)//One hour minimum repeat interval
{
AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "RepeatInterval", await Translate("ErrorRepeatIntervalTooSmall"));
}
@@ -5220,16 +5223,17 @@ namespace AyaNova.Biz
//
internal static async Task GenerateAsync(AyContext ct, ILogger log)
{
#if (DEBUG)
log.LogInformation("PMBiz - Generating");
#endif
// #if (DEBUG)
// log.LogInformation("PMBiz - Generating");
// #endif
//Get a list of PM id's ready for conversion now
var l = await ct.PM.AsNoTracking()
.Where(z => z.GenerateDate < DateTime.UtcNow && (z.StopGeneratingDate == null || z.StopGeneratingDate > DateTime.UtcNow) && z.Active == true)
.Select(z => z.Id)
.ToListAsync();
#if (DEBUG)
log.LogInformation($"PMBiz - Found {l.Count} ready to generate PM items");
if (l.Count > 0)
log.LogInformation($"PMBiz - Found {l.Count} ready to generate PM items");
#endif
//process those items