After we update server settings related to tasks, reschedule them to ensure they take effect.
This commit is contained in:
parent
55054d1910
commit
5186508aff
1 changed files with 4 additions and 1 deletions
|
@ -18,11 +18,13 @@ namespace API.Controllers
|
||||||
{
|
{
|
||||||
private readonly ILogger<SettingsController> _logger;
|
private readonly ILogger<SettingsController> _logger;
|
||||||
private readonly IUnitOfWork _unitOfWork;
|
private readonly IUnitOfWork _unitOfWork;
|
||||||
|
private readonly ITaskScheduler _taskScheduler;
|
||||||
|
|
||||||
public SettingsController(ILogger<SettingsController> logger, IUnitOfWork unitOfWork)
|
public SettingsController(ILogger<SettingsController> logger, IUnitOfWork unitOfWork, ITaskScheduler taskScheduler)
|
||||||
{
|
{
|
||||||
_logger = logger;
|
_logger = logger;
|
||||||
_unitOfWork = unitOfWork;
|
_unitOfWork = unitOfWork;
|
||||||
|
_taskScheduler = taskScheduler;
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpGet("")]
|
[HttpGet("")]
|
||||||
|
@ -77,6 +79,7 @@ namespace API.Controllers
|
||||||
if (_unitOfWork.HasChanges() && await _unitOfWork.Complete())
|
if (_unitOfWork.HasChanges() && await _unitOfWork.Complete())
|
||||||
{
|
{
|
||||||
_logger.LogInformation("Server Settings updated");
|
_logger.LogInformation("Server Settings updated");
|
||||||
|
_taskScheduler.ScheduleTasks();
|
||||||
return Ok(updateSettingsDto);
|
return Ok(updateSettingsDto);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue