Polish for Release (#2841)
This commit is contained in:
parent
a76de06087
commit
e6e228c3d9
15 changed files with 46 additions and 36 deletions
|
@ -205,14 +205,12 @@ public class LicenseService(
|
|||
InstallId = HashUtil.ServerToken()
|
||||
})
|
||||
.ReceiveString();
|
||||
|
||||
var result = bool.Parse(response);
|
||||
|
||||
if (!result)
|
||||
{
|
||||
var provider = cachingProviderFactory.GetCachingProvider(EasyCacheProfiles.License);
|
||||
await provider.FlushAsync();
|
||||
await provider.SetAsync(CacheKey, result, _licenseCacheTimeout);
|
||||
}
|
||||
var provider = cachingProviderFactory.GetCachingProvider(EasyCacheProfiles.License);
|
||||
await provider.FlushAsync();
|
||||
await provider.SetAsync(CacheKey, result, _licenseCacheTimeout);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -229,6 +227,7 @@ public class LicenseService(
|
|||
serverSetting.Value = string.Empty;
|
||||
unitOfWork.SettingsRepository.Update(serverSetting);
|
||||
await unitOfWork.CommitAsync();
|
||||
|
||||
var provider = cachingProviderFactory.GetCachingProvider(EasyCacheProfiles.License);
|
||||
await provider.RemoveAsync(CacheKey);
|
||||
}
|
||||
|
|
|
@ -169,12 +169,12 @@ public class TaskScheduler : ITaskScheduler
|
|||
{
|
||||
return;
|
||||
}
|
||||
|
||||
RecurringJob.AddOrUpdate(CheckScrobblingTokensId, () => _scrobblingService.CheckExternalAccessTokens(),
|
||||
Cron.Daily, RecurringJobOptions);
|
||||
BackgroundJob.Enqueue(() => _scrobblingService.CheckExternalAccessTokens()); // We also kick off an immediate check on startup
|
||||
RecurringJob.AddOrUpdate(LicenseCheckId, () => _licenseService.HasActiveLicense(true),
|
||||
LicenseService.Cron, RecurringJobOptions);
|
||||
BackgroundJob.Enqueue(() => _licenseService.HasActiveLicense(true));
|
||||
|
||||
// KavitaPlus Scrobbling (every 4 hours)
|
||||
RecurringJob.AddOrUpdate(ProcessScrobblingEventsId, () => _scrobblingService.ProcessUpdatesSinceLastSync(),
|
||||
|
|
|
@ -254,7 +254,7 @@ public class ScannerService : IScannerService
|
|||
// Transform seen series into the parsedSeries (I think we can actually just have processedSeries be used instead
|
||||
TrackFoundSeriesAndFiles(parsedSeries, processedSeries);
|
||||
|
||||
_logger.LogInformation("ScanFiles for {Series} took {Time}", series.Name, scanElapsedTime);
|
||||
_logger.LogInformation("ScanFiles for {Series} took {Time} milliseconds", series.Name, scanElapsedTime);
|
||||
|
||||
// We now technically have all scannedSeries, we could invoke each Series to be scanned
|
||||
|
||||
|
|
|
@ -147,6 +147,6 @@ public class TokenService : ITokenService
|
|||
if (string.IsNullOrEmpty(token)) return true;
|
||||
var tokenHandler = new JwtSecurityTokenHandler();
|
||||
var tokenContent = tokenHandler.ReadJwtToken(token);
|
||||
return tokenContent.ValidTo <= DateTime.UtcNow;
|
||||
return tokenContent.ValidTo >= DateTime.UtcNow;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue