This commit is contained in:
2022-10-26 01:39:48 +00:00
parent daeaead405
commit 82fa388776
2 changed files with 21 additions and 14 deletions

View File

@@ -70,21 +70,22 @@ namespace rockfishCore.Controllers
return Ok("Request awaiting approval");
}
//OK, no idea why we care about this, you can't re-request a trial if you're doing one so I"m commenting out this block as it's messing with testing expired key re-request
//2022-10-25
//I can't see any reason for it but if it should come up can just uncomment again later
// //if there is an active trial for this db then can't do this they must request we re-release it or completely zap the database instead
// long MustBeOlderThan = 0;
// if (r.Perpetual)
// MustBeOlderThan = DateUtil.DateToEpoch(DateTime.UtcNow.AddDays((RavenKeyFactory.TRIAL_PERIOD_DAYS * -1)));
// else
// MustBeOlderThan = DateUtil.DateToEpoch(DateTime.UtcNow.AddDays((RavenKeyFactory.TRIAL_PERIOD_DAYS * -1)));
//if there is an active trial for this db then can't do this they must request we re-release it or completely zap the database instead
long MustBeOlderThan = 0;
if (r.Perpetual)
MustBeOlderThan = DateUtil.DateToEpoch(DateTime.Now.AddDays((RavenKeyFactory.TRIAL_PERIOD_DAYS * -1)));
else
MustBeOlderThan = DateUtil.DateToEpoch(DateTime.Now.AddDays((RavenKeyFactory.TRIAL_PERIOD_DAYS * -1)));
if (await ct.TrialRequest.Where(z => z.DbId == r.DbId && z.DtProcessed != null && z.DtProcessed > MustBeOlderThan).AnyAsync())
{
return BadRequest("E1000 - Can't trial; there is already an active trial license issued for this database Id");
}
// if (await ct.TrialRequest.Where(z => z.DbId == r.DbId && z.DtProcessed != null && z.DtProcessed > MustBeOlderThan).AnyAsync())
// {
// return BadRequest("E1000 - Can't trial; there is already an active trial license issued for this database Id");
// }
//Everything seems to be in order, save the request and return ok
var NewRequest = new TrialRequest();