aboutsummaryrefslogtreecommitdiff
path: root/Timeline/Program.cs
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2020-06-14 22:18:25 +0800
committercrupest <crupest@outlook.com>2020-06-14 22:18:25 +0800
commit98f1ec6e27616d292f86cce30223f0a267c35fd3 (patch)
tree13c609ef7132d5c6791756f8203fc181c161f08e /Timeline/Program.cs
parent0b71a0c3d3c8b86c01ea8d56d63ba5a0c6655646 (diff)
downloadtimeline-98f1ec6e27616d292f86cce30223f0a267c35fd3.tar.gz
timeline-98f1ec6e27616d292f86cce30223f0a267c35fd3.tar.bz2
timeline-98f1ec6e27616d292f86cce30223f0a267c35fd3.zip
feat(back): Add backup service and run it when start.
Diffstat (limited to 'Timeline/Program.cs')
-rw-r--r--Timeline/Program.cs5
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())