From 545edc7632570977b550ecffce17fbe9801709db Mon Sep 17 00:00:00 2001 From: Maxwell Weru Date: Tue, 19 Sep 2023 16:51:22 +0300 Subject: [PATCH] Remove LoadSchedulesOnStartup option --- server/Tingle.Dependabot/AppSetup.cs | 3 ++- server/Tingle.Dependabot/Properties/launchSettings.json | 3 ++- server/Tingle.Dependabot/Workflow/WorkflowOptions.cs | 3 --- server/Tingle.Dependabot/appsettings.json | 1 - server/main.bicep | 1 - server/main.json | 4 ---- 6 files changed, 4 insertions(+), 11 deletions(-) diff --git a/server/Tingle.Dependabot/AppSetup.cs b/server/Tingle.Dependabot/AppSetup.cs index 1e586914..0e2f51d5 100644 --- a/server/Tingle.Dependabot/AppSetup.cs +++ b/server/Tingle.Dependabot/AppSetup.cs @@ -29,7 +29,8 @@ public static async Task SetupAsync(WebApplication app, CancellationToken cancel await synchronizer.SynchronizeAsync(false, cancellationToken); /* database sync should not trigger, just in case it's too many */ } - if (options.LoadSchedulesOnStartup) + // skip loading schedules if told to + if (!app.Configuration.GetValue("SKIP_LOAD_SCHEDULES")) { var dbContext = provider.GetRequiredService(); var repositories = await dbContext.Repositories.ToListAsync(cancellationToken); diff --git a/server/Tingle.Dependabot/Properties/launchSettings.json b/server/Tingle.Dependabot/Properties/launchSettings.json index c5ef3170..55a49472 100644 --- a/server/Tingle.Dependabot/Properties/launchSettings.json +++ b/server/Tingle.Dependabot/Properties/launchSettings.json @@ -8,7 +8,8 @@ "applicationUrl": "https://localhost:44390;http://localhost:59269", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development", - "EFCORE_PERFORM_MIGRATIONS": "true" + "EFCORE_PERFORM_MIGRATIONS": "true", + "SKIP_LOAD_SCHEDULES": "true" } }, "Docker": { diff --git a/server/Tingle.Dependabot/Workflow/WorkflowOptions.cs b/server/Tingle.Dependabot/Workflow/WorkflowOptions.cs index 18913ad3..b35205ef 100644 --- a/server/Tingle.Dependabot/Workflow/WorkflowOptions.cs +++ b/server/Tingle.Dependabot/Workflow/WorkflowOptions.cs @@ -7,9 +7,6 @@ public class WorkflowOptions /// Whether to synchronize repositories on startup. public bool SynchronizeOnStartup { get; set; } = true; - /// Whether to load schedules on startup. - public bool LoadSchedulesOnStartup { get; set; } = true; - /// Whether to create/update notifications on startup. public bool CreateOrUpdateWebhooksOnStartup { get; set; } = true; diff --git a/server/Tingle.Dependabot/appsettings.json b/server/Tingle.Dependabot/appsettings.json index ef47ae45..a9af7602 100644 --- a/server/Tingle.Dependabot/appsettings.json +++ b/server/Tingle.Dependabot/appsettings.json @@ -56,7 +56,6 @@ "Workflow": { "SynchronizeOnStartup": false, - "LoadSchedulesOnStartup": false, "CreateOrUpdateWebhooksOnStartup": false, "WebhookEndpoint": "http://localhost:3000/", "SubscriptionPassword": "", diff --git a/server/main.bicep b/server/main.bicep index d9e65613..e679dc59 100644 --- a/server/main.bicep +++ b/server/main.bicep @@ -282,7 +282,6 @@ resource app 'Microsoft.App/containerApps@2023-05-01' = { { name: 'ConnectionStrings__Sql', secretRef: 'connection-strings-sql' } { name: 'Workflow__SynchronizeOnStartup', value: synchronizeOnStartup ? 'true' : 'false' } - { name: 'Workflow__LoadSchedulesOnStartup', value: 'true' } { name: 'Workflow__CreateOrUpdateWebhooksOnStartup', value: createOrUpdateWebhooksOnStartup ? 'true' : 'false' } { name: 'Workflow__ProjectUrl', value: projectUrl } { name: 'Workflow__ProjectToken', secretRef: 'project-token' } diff --git a/server/main.json b/server/main.json index ba4dc90b..77b9dbd1 100644 --- a/server/main.json +++ b/server/main.json @@ -414,10 +414,6 @@ "name": "Workflow__SynchronizeOnStartup", "value": "[if(parameters('synchronizeOnStartup'), 'true', 'false')]" }, - { - "name": "Workflow__LoadSchedulesOnStartup", - "value": "true" - }, { "name": "Workflow__CreateOrUpdateWebhooksOnStartup", "value": "[if(parameters('createOrUpdateWebhooksOnStartup'), 'true', 'false')]"