Skip to content

Commit

Permalink
* fix some violation of ReSharper inspections
Browse files Browse the repository at this point in the history
- method `AcquireUidLocksForSave()` that being unused since 10d5cbd @ UserSaver.cs
@ c#/crawler
  • Loading branch information
n0099 committed Jul 11, 2024
1 parent 5a599c9 commit de7d94c
Show file tree
Hide file tree
Showing 10 changed files with 9 additions and 11 deletions.
3 changes: 2 additions & 1 deletion c#/crawler/src/Db/LatestReplier.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
namespace tbm.Crawler.Db;
// ReSharper disable PropertyCanBeMadeInitOnly.Global
namespace tbm.Crawler.Db;

public class LatestReplier : BaseUser
{
Expand Down
2 changes: 1 addition & 1 deletion c#/crawler/src/Tieba/Crawl/Saver/Post/SubReplySaver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ protected override Lazy<Dictionary<Type, AddSplitRevisionsDelegate>>
_addSplitRevisionsDelegatesKeyByEntityType ??= new(() => new()
{
{typeof(SubReplyRevision.SplitAgreeCount), AddRevisionsWithDuplicateIndex<SubReplyRevision.SplitAgreeCount>},
{typeof(SubReplyRevision.SplitDisagreeCount), AddRevisionsWithDuplicateIndex<SubReplyRevision.SplitDisagreeCount>},
{typeof(SubReplyRevision.SplitDisagreeCount), AddRevisionsWithDuplicateIndex<SubReplyRevision.SplitDisagreeCount>}
});

protected override Spid RevisionIdSelector(BaseSubReplyRevision entity) => entity.Spid;
Expand Down
2 changes: 0 additions & 2 deletions c#/crawler/src/Tieba/Crawl/Saver/SaverWithRevision.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using Microsoft.EntityFrameworkCore.ChangeTracking;

namespace tbm.Crawler.Tieba.Crawl.Saver;

public abstract partial class SaverWithRevision<TBaseRevision, TRevisionId>(
Expand Down
5 changes: 0 additions & 5 deletions c#/crawler/src/Tieba/Crawl/Saver/UserSaver.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using Microsoft.EntityFrameworkCore.ChangeTracking;

namespace tbm.Crawler.Tieba.Crawl.Saver;

public partial class UserSaver(
Expand Down Expand Up @@ -43,9 +41,6 @@ where newlyLocked.Contains(user.Uid)
userFieldRevisionIgnorance);
}

public IEnumerable<Uid> AcquireUidLocksForSave(IEnumerable<Uid> usersId) =>
_saverLocks.Value.Acquire(usersId.ToList());

public void OnPostSave() => _saverLocks.Value.Dispose();
}
public partial class UserSaver
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
namespace tbm.Crawler.Worker;

// ReSharper disable once UnusedType.Global
public class ProcessImagesInAllReplyContentsWorker(
ILogger<ProcessImagesInAllReplyContentsWorker> logger,
IConfiguration config,
Expand Down
1 change: 1 addition & 0 deletions c#/crawler/src/Worker/RetryCrawlWorker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ protected override async Task DoWork(CancellationToken stoppingToken)
var pages = failureCountsKeyByPage.Keys.ToList();
FailureCount FailureCountSelector(Page p) => failureCountsKeyByPage[p];
// ReSharper disable once SwitchStatementMissingSomeEnumCasesNoDefault
switch (lockType)
{
case CrawlerLocks.Type.Thread:
Expand Down
1 change: 1 addition & 0 deletions c#/imagePipeline/src/Db/ImageWithFrameIndex.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// ReSharper disable PropertyCanBeMadeInitOnly.Global
namespace tbm.ImagePipeline.Db;

public abstract class ImageWithFrameIndex : EntityWithImageId
Expand Down
1 change: 1 addition & 0 deletions c#/shared/src/Db/EntityWithImageId.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// ReSharper disable PropertyCanBeMadeInitOnly.Global
using System.ComponentModel.DataAnnotations;

namespace tbm.Shared.Db;
Expand Down
1 change: 1 addition & 0 deletions c#/shared/src/Db/RowVersionedEntity.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// ReSharper disable PropertyCanBeMadeInitOnly.Global
using System.ComponentModel.DataAnnotations;

namespace tbm.Shared.Db;
Expand Down
3 changes: 1 addition & 2 deletions c#/shared/src/TransformEntityWorker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using System.Text.Json;
using System.Text.Unicode;
using Microsoft.EntityFrameworkCore.ChangeTracking;
using SuperLinq;
using tbm.Shared.Db;

namespace tbm.Shared;
Expand All @@ -14,7 +13,7 @@ public abstract class TransformEntityWorker()
protected static readonly JsonSerializerOptions JsonSerializerOptions = new()
{
IncludeFields = true,
Encoder = JavaScriptEncoder.Create(UnicodeRanges.All),
Encoder = JavaScriptEncoder.Create(UnicodeRanges.All)
};
}

Expand Down

0 comments on commit de7d94c

Please sign in to comment.