Skip to content

Commit

Permalink
Fixed logical error related to "BackupOnStartup".
Browse files Browse the repository at this point in the history
  • Loading branch information
byerlikaya committed Mar 4, 2024
1 parent 78ad84f commit 3c5d3fe
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ public override Task StartAsync(CancellationToken cancellationToken)
{
logger.LogInformation("Backup Background Service is starting.");

RunBackup();
if (options.BackupOnStartup)
RunBackup();

return base.StartAsync(cancellationToken);
}
Expand Down Expand Up @@ -42,9 +43,6 @@ private void RunBackup()
if (options.DebugMode)
return;

if (!options.BackupOnStartup)
return;

using var scope = serviceProvider.CreateScope();
var sqlBackup = scope.ServiceProvider.GetRequiredService<SqlBackup>();
sqlBackup.BackupAndZipUploadToS3V1();
Expand Down
2 changes: 1 addition & 1 deletion src/SqlBackupToS3/SqlBackupToS3.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<PropertyGroup>
<PackageId>SqlBackupToS3</PackageId>
<Version>2.1.0</Version>
<Version>2.1.1</Version>
<Authors>Barış Yerlikaya</Authors>
<Company>Barış Yerlikaya</Company>
<Product>SqlBackupToS3</Product>
Expand Down

0 comments on commit 3c5d3fe

Please sign in to comment.