diff --git a/src/Api/Controllers/JobsController.cs b/src/Api/Controllers/JobsController.cs deleted file mode 100644 index bc612ac015..0000000000 --- a/src/Api/Controllers/JobsController.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc; -using Bit.Api.Utilities; -using Microsoft.AspNetCore.Authorization; -using Bit.Core.Services; - -namespace Bit.Api.Controllers -{ - [Route("jobs")] - [SelfHosted(SelfHostedOnly = true)] - [AllowAnonymous] - public class JobsController : Controller - { - private readonly ILicensingService _licensingService; - private readonly IUserService _userService; - - public JobsController( - ILicensingService licensingService, - IUserService userService) - { - _licensingService = licensingService; - _userService = userService; - } - - [HttpPost("organization-license")] - public async Task PostOrganizationLicense() - { - await _licensingService.ValidateOrganizationsAsync(); - } - - [HttpPost("refresh-licenses")] - public Task PostRefreshLicenses() - { - // TODO - return Task.FromResult(0); - } - } -} diff --git a/src/Jobs/Program.cs b/src/Jobs/Program.cs index 23e42fc8c3..9f6910b2b1 100644 --- a/src/Jobs/Program.cs +++ b/src/Jobs/Program.cs @@ -53,9 +53,12 @@ namespace Bit.Jobs { switch(parameters["j"]) { - case "validate-licenses": + case "validate-organizations": await _licensingService.ValidateOrganizationsAsync(); break; + case "validate-users": + // TODO + break; case "refresh-licenses": // TODO break; diff --git a/src/Jobs/Startup.cs b/src/Jobs/Startup.cs index c09eb7be36..302678d384 100644 --- a/src/Jobs/Startup.cs +++ b/src/Jobs/Startup.cs @@ -56,10 +56,7 @@ namespace Bit.Jobs GlobalSettings globalSettings) { loggerFactory - .AddSerilog(env, appLifetime, globalSettings, (e) => - { - return e.Level >= LogEventLevel.Information; - }) + .AddSerilog(env, appLifetime, globalSettings, e => e.Level >= LogEventLevel.Information) .AddConsole() .AddDebug(); } diff --git a/src/Jobs/crontab b/src/Jobs/crontab index 98d569e35f..bad2ffeac1 100644 --- a/src/Jobs/crontab +++ b/src/Jobs/crontab @@ -1,3 +1,4 @@ 0 * * * * root dotnet /jobs/Jobs.dll -d /jobs -j alive >> /var/log/cron.log 2>&1 -0 */6 * * * root dotnet /jobs/Jobs.dll -d /jobs -j validate-licenses >> /var/log/cron.log 2>&1 +0 */6 * * * root dotnet /jobs/Jobs.dll -d /jobs -j validate-organizations >> /var/log/cron.log 2>&1 + # An empty line is required at the end of this file for a valid cron file. \ No newline at end of file diff --git a/util/Setup/Setup.csproj b/util/Setup/Setup.csproj index 8908549182..ce1697ae88 100644 --- a/util/Setup/Setup.csproj +++ b/util/Setup/Setup.csproj @@ -5,9 +5,4 @@ netcoreapp2.0 - - full - true - -