Skip to content

Commit

Permalink
A few extra cases where we should reschedule K+ jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
majora2007 committed Jan 17, 2024
1 parent 0e7a346 commit 81835a4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion API/Controllers/LicenseController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,12 @@ public class LicenseController(
[ResponseCache(CacheProfileName = ResponseCacheProfiles.LicenseCache)]
public async Task<ActionResult<bool>> HasValidLicense(bool forceCheck = false)
{
return Ok(await licenseService.HasActiveLicense(forceCheck));
var ret = await licenseService.HasActiveLicense(forceCheck);
if (ret)
{
await taskScheduler.ScheduleKavitaPlusTasks();
}
return Ok(ret);
}

/// <summary>
Expand All @@ -57,6 +62,7 @@ public async Task<ActionResult> RemoveLicense()
setting.Value = null;
unitOfWork.SettingsRepository.Update(setting);
await unitOfWork.CommitAsync();
await taskScheduler.ScheduleKavitaPlusTasks();
return Ok();
}

Expand Down

0 comments on commit 81835a4

Please sign in to comment.