Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Aragas committed Feb 24, 2024
1 parent 7ef437b commit d55db81
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ private string GenerateFileId(CancellationToken ct)
var fileIds = _hexGenerator.GetHex(count, 3);
var existing = _dbContext.Set<IdEntity>().Select(x => x.FileId).Where(x => fileIds.Contains(x)).ToHashSet();
if (existing.Count == count) continue;
fileId = existing.First(x => !fileIds.Contains(x));
break;
if (existing.Count == 0) return fileIds.First();
return existing.First(x => !fileIds.Contains(x));
}
return fileId;
}
Expand Down

0 comments on commit d55db81

Please sign in to comment.