diff --git a/azure_functions/package-lock.json b/azure_functions/package-lock.json index 07d9cb57..232ae991 100644 --- a/azure_functions/package-lock.json +++ b/azure_functions/package-lock.json @@ -12,7 +12,7 @@ "@azure/storage-queue": "12.23.0" }, "devDependencies": { - "@types/node": "20.16.3", + "@types/node": "20.16.4", "rimraf": "6.0.1", "typescript": "5.5.4" } @@ -275,9 +275,9 @@ } }, "node_modules/@types/node": { - "version": "20.16.3", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.16.3.tgz", - "integrity": "sha512-/wdGiWRkMOm53gAsSyFMXFZHbVg7C6CbkrzHNpaHoYfsUWPg7m6ZRKtvQjgvQ9i8WT540a3ydRlRQbxjY30XxQ==", + "version": "20.16.4", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.16.4.tgz", + "integrity": "sha512-ioyQ1zK9aGEomJ45zz8S8IdzElyxhvP1RVWnPrXDf6wFaUb+kk1tEcVVJkF7RPGM0VWI7cp5U57oCPIn5iN1qg==", "dev": true, "license": "MIT", "dependencies": { diff --git a/azure_functions/package.json b/azure_functions/package.json index 159e0307..6622d542 100644 --- a/azure_functions/package.json +++ b/azure_functions/package.json @@ -15,7 +15,7 @@ "@azure/storage-queue": "12.23.0" }, "devDependencies": { - "@types/node": "20.16.3", + "@types/node": "20.16.4", "rimraf": "6.0.1", "typescript": "5.5.4" }, diff --git a/operations/template/logs.tf b/operations/template/logs.tf index 5e480772..a34436d2 100644 --- a/operations/template/logs.tf +++ b/operations/template/logs.tf @@ -25,7 +25,7 @@ resource "azurerm_log_analytics_query_pack" "application_logs_pack" { } } -resource "azurerm_log_analytics_query_pack_query" "example" { +resource "azurerm_log_analytics_query_pack_query" "structured_application_logs" { display_name = "RS SFTP's Raw Application Logs" description = "View all RS SFTP's application logs in a structured format" diff --git a/src/cmd/main.go b/src/cmd/main.go index c5f0721e..c7640356 100644 --- a/src/cmd/main.go +++ b/src/cmd/main.go @@ -7,6 +7,7 @@ import ( "log/slog" "net/http" "os" + "time" ) func main() { @@ -17,6 +18,19 @@ func main() { go setupHealthCheck() + setUpQueues() + + // This loop keeps the app alive. This lets the pre-live deployment slot remain healthy + // even though it's configured without queues, which means we can quickly swap slots + // if needed without having to redeploy + for { + t := time.Now() + slog.Info(t.Format("2006-01-02T15:04:05Z07:00")) + time.Sleep(10 * time.Minute) + } +} + +func setUpQueues() { // Set up the polling message handler and queue listener pollingMessageHandler := orchestration.PollingMessageHandler{} @@ -40,8 +54,10 @@ func main() { slog.Warn("Failed to create importQueueHandler", slog.Any(utils.ErrorKey, err)) return } - // This ListenToQueue is not split into a separate Go Routine since it is the core driver of the application - importQueueHandler.ListenToQueue() + + go func() { + importQueueHandler.ListenToQueue() + }() } func setupLogging() {