diff options
author | crupest <crupest@outlook.com> | 2020-06-14 22:18:25 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2020-06-14 22:18:25 +0800 |
commit | cf2cfa4853944ce0af6b6c22a089b937dd59ccaf (patch) | |
tree | 7a18386165130e83bc1fa980a7796e2a83e6894a /Timeline/Program.cs | |
parent | fd4a16df9d67ac017ea5c7f7ca5e4ef45f16c6a2 (diff) | |
download | timeline-cf2cfa4853944ce0af6b6c22a089b937dd59ccaf.tar.gz timeline-cf2cfa4853944ce0af6b6c22a089b937dd59ccaf.tar.bz2 timeline-cf2cfa4853944ce0af6b6c22a089b937dd59ccaf.zip |
feat(back): Add backup service and run it when start.
Diffstat (limited to 'Timeline/Program.cs')
-rw-r--r-- | Timeline/Program.cs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Timeline/Program.cs b/Timeline/Program.cs index c49f74b0..0540fbd1 100644 --- a/Timeline/Program.cs +++ b/Timeline/Program.cs @@ -5,6 +5,7 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting;
using System.Resources;
using Timeline.Entities;
+using Timeline.Services;
[assembly: NeutralResourcesLanguage("en")]
@@ -17,6 +18,10 @@ namespace Timeline var host = CreateWebHostBuilder(args).Build();
var env = host.Services.GetRequiredService<IWebHostEnvironment>();
+
+ var databaseBackupService = host.Services.GetRequiredService<IDatabaseBackupService>();
+ databaseBackupService.BackupNow();
+
if (env.IsProduction())
{
using (var scope = host.Services.CreateScope())
|