Skip to content

Commit

Permalink
change status && add retry for cc error
Browse files Browse the repository at this point in the history
  • Loading branch information
qdraw committed Oct 25, 2024
1 parent d38eb30 commit 65a3884
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ await _updateStatusGeneratedThumbnailService.AddOrUpdateStatusAsync(
}

var filteredData = resultData
.Where(p => p.Status == FileIndexItem.ExifStatus.Ok).ToList();
.Where(p => p.Status is FileIndexItem.ExifStatus.Ok or FileIndexItem.ExifStatus.OkAndSame).ToList();

if ( filteredData.Count == 0 )
{
Expand Down
13 changes: 11 additions & 2 deletions starsky/starsky.foundation.database/Import/ImportQuery.cs
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,17 @@ await RetryHelper.DoAsync(LocalRemoveDefaultQuery,
}
catch ( DbUpdateConcurrencyException exception )
{
_logger.LogInformation(exception, "[RemoveItemAsync] catch-ed " +
"DbUpdateConcurrencyException (do nothing)");
_logger.LogInformation("[RemoveItemAsync] catch-ed " +
"DbUpdateConcurrencyException (retry) {exception}", exception.Message);
try
{
await RetryHelper.DoAsync(LocalRemoveDefaultQuery, TimeSpan.FromSeconds(2), 2);
}
catch ( AggregateException )
{
_logger.LogInformation("[RemoveItemAsync] catch-ed " +
"AggregateException (ignored after retry) {exception}", exception.Message);
}
}

return importIndexItem;
Expand Down

0 comments on commit 65a3884

Please sign in to comment.