Skip to content

Commit

Permalink
Converted exceptions while adding an unmodified file to the database …
Browse files Browse the repository at this point in the history
…to a log message to avoid stopping the backup when this errors out.
  • Loading branch information
kenkendk committed Aug 14, 2018
1 parent c00e6fd commit 5e130fa
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 4 deletions.
10 changes: 9 additions & 1 deletion Duplicati/Library/Main/Operation/Backup/FileBlockProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,15 @@ public static Task Run(Snapshots.ISnapshotService snapshot, Options options, Bac
{
// When we write the file to output, update the last modified time
Logging.Log.WriteVerboseMessage(FILELOGTAG, "NoFileChanges", "File has not changed {0}", e.Path);
await database.AddUnmodifiedAsync(e.OldId, e.LastWrite);
try
{
await database.AddUnmodifiedAsync(e.OldId, e.LastWrite);
}
catch (Exception ex)
{
Logging.Log.WriteWarningMessage(FILELOGTAG, "FailedToAddFile", ex, "Failed while attempting to add unmodified file to database: {0}", e.Path);
}
}
}
catch(Exception ex)
Expand Down
22 changes: 19 additions & 3 deletions Duplicati/Library/Main/Operation/Backup/FilePreFilterProcess.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,16 @@ public static Task Run(Snapshots.ISnapshotService snapshot, Options options, Bac
if (CHECKFILETIMEONLY && !timestampChanged && !isNewFile)
{
Logging.Log.WriteVerboseMessage(FILELOGTAG, "SkipCheckNoTimestampChange", "Skipped checking file, because timestamp was not updated {0}", e.Path);
await database.AddUnmodifiedAsync(e.OldId, e.LastWrite);
try
{
await database.AddUnmodifiedAsync(e.OldId, e.LastWrite);
}
catch (Exception ex)
{
if (ex.IsRetiredException())
throw;
Logging.Log.WriteWarningMessage(FILELOGTAG, "FailedToAddFile", ex, "Failed while attempting to add unmodified file to database: {0}", e.Path);
}
continue;
}
Expand Down Expand Up @@ -127,8 +136,15 @@ public static Task Run(Snapshots.ISnapshotService snapshot, Options options, Bac
}
else
{
Logging.Log.WriteVerboseMessage(FILELOGTAG, "SkipCheckNoMetadataChange", "Skipped checking file, because no metadata was updated {0}", e.Path);
await database.AddUnmodifiedAsync(e.OldId, e.LastWrite);
Logging.Log.WriteVerboseMessage(FILELOGTAG, "SkipCheckNoMetadataChange", "Skipped checking file, because no metadata was updated {0}", e.Path);
try
{
await database.AddUnmodifiedAsync(e.OldId, e.LastWrite);
}
catch (Exception ex)
{
Logging.Log.WriteWarningMessage(FILELOGTAG, "FailedToAddFile", ex, "Failed while attempting to add unmodified file to database: {0}", e.Path);
}
}
}
});
Expand Down

1 comment on commit 5e130fa

@duplicatibot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit has been mentioned on Duplicati. There might be relevant details there:

https://forum.duplicati.com/t/warning-on-sql-server-database-backup/5603/5

Please sign in to comment.