From f18e517b1ac9d9b30c35d698f23d37293ad7451d Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Wed, 15 Nov 2017 08:10:23 -0500 Subject: [PATCH] db maintenance function --- util/Function/DatabaseMaintenance.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/util/Function/DatabaseMaintenance.cs b/util/Function/DatabaseMaintenance.cs index aca69e7075..b1c9c565c5 100644 --- a/util/Function/DatabaseMaintenance.cs +++ b/util/Function/DatabaseMaintenance.cs @@ -10,9 +10,9 @@ namespace Bit.Function public static class DatabaseMaintenance { [FunctionName("DatabaseMaintenance")] - public static void Run([TimerTrigger("0 0 * * *")]TimerInfo myTimer, TraceWriter log) + public static void Run([TimerTrigger("0 0 4 * * *")]TimerInfo myTimer, TraceWriter log) { - var connectionString = ConfigurationManager.ConnectionStrings["vault_db"].ConnectionString; + var connectionString = ConfigurationManager.ConnectionStrings["Vault"].ConnectionString; using(var connection = new SqlConnection(connectionString)) { connection.Open(); @@ -33,6 +33,8 @@ namespace Bit.Function // Asynchronous BeginExecuteNonQuery for this long running sproc to avoid timeouts var result = cmd.BeginExecuteNonQuery(); cmd.EndExecuteNonQuery(result); + + log.Info($"Started [dbo].[AzureSQLMaintenance] at {DateTime.UtcNow}."); } } }