diff --git a/c#/crawler/src/Tieba/Crawl/Facade/ReplyCrawlFacade.cs b/c#/crawler/src/Tieba/Crawl/Facade/ReplyCrawlFacade.cs index 98ed7bc3..6bb393e1 100644 --- a/c#/crawler/src/Tieba/Crawl/Facade/ReplyCrawlFacade.cs +++ b/c#/crawler/src/Tieba/Crawl/Facade/ReplyCrawlFacade.cs @@ -1,16 +1,16 @@ namespace tbm.Crawler.Tieba.Crawl.Facade; public class ReplyCrawlFacade( - ReplyCrawler.New crawlerFactory, - Fid fid, - Tid tid, - IIndex locks, - ReplyParser postParser, - ReplySaver.New postSaverFactory, - UserParser.New userParserFactory, - UserSaver.New userSaverFactory, - CrawlerDbContext.New dbContextFactory, - SonicPusher sonicPusher) + ReplyCrawler.New crawlerFactory, + Fid fid, + Tid tid, + IIndex locks, + ReplyParser postParser, + ReplySaver.New postSaverFactory, + UserParser.New userParserFactory, + UserSaver.New userSaverFactory, + CrawlerDbContext.New dbContextFactory, + SonicPusher sonicPusher) : CrawlFacade( crawlerFactory(fid, tid), fid, new(fid, tid), locks[CrawlerLocks.Type.Reply], postParser, postSaverFactory.Invoke, diff --git a/c#/crawler/src/Tieba/Crawl/Facade/SubReplyCrawlFacade.cs b/c#/crawler/src/Tieba/Crawl/Facade/SubReplyCrawlFacade.cs index 4e815552..cfcc3638 100644 --- a/c#/crawler/src/Tieba/Crawl/Facade/SubReplyCrawlFacade.cs +++ b/c#/crawler/src/Tieba/Crawl/Facade/SubReplyCrawlFacade.cs @@ -1,16 +1,16 @@ namespace tbm.Crawler.Tieba.Crawl.Facade; public class SubReplyCrawlFacade( - SubReplyCrawler.New crawlerFactory, - Fid fid, - Tid tid, - Pid pid, - IIndex locks, - SubReplyParser postParser, - SubReplySaver.New postSaverFactory, - UserParser.New userParserFactory, - UserSaver.New userSaverFactory, - SonicPusher sonicPusher) + SubReplyCrawler.New crawlerFactory, + Fid fid, + Tid tid, + Pid pid, + IIndex locks, + SubReplyParser postParser, + SubReplySaver.New postSaverFactory, + UserParser.New userParserFactory, + UserSaver.New userSaverFactory, + SonicPusher sonicPusher) : CrawlFacade( crawlerFactory(tid, pid), fid, new(fid, tid, pid), locks[CrawlerLocks.Type.SubReply], postParser, postSaverFactory.Invoke, diff --git a/c#/crawler/src/Tieba/Crawl/Facade/ThreadArchiveCrawlFacade.cs b/c#/crawler/src/Tieba/Crawl/Facade/ThreadArchiveCrawlFacade.cs index c333a118..6e06102e 100644 --- a/c#/crawler/src/Tieba/Crawl/Facade/ThreadArchiveCrawlFacade.cs +++ b/c#/crawler/src/Tieba/Crawl/Facade/ThreadArchiveCrawlFacade.cs @@ -1,14 +1,14 @@ namespace tbm.Crawler.Tieba.Crawl.Facade; public class ThreadArchiveCrawlFacade( - ThreadArchiveCrawler.New crawlerFactory, - string forumName, - Fid fid, - IIndex locks, - ThreadParser postParser, - ThreadSaver.New postSaverFactory, - UserParser.New userParserFactory, - UserSaver.New userSaverFactory) + ThreadArchiveCrawler.New crawlerFactory, + string forumName, + Fid fid, + IIndex locks, + ThreadParser postParser, + ThreadSaver.New postSaverFactory, + UserParser.New userParserFactory, + UserSaver.New userSaverFactory) : ThreadCrawlFacade( crawlerFactory.Invoke, forumName, fid, locks, postParser, postSaverFactory, diff --git a/c#/crawler/src/Tieba/Crawl/Facade/ThreadCrawlFacade.cs b/c#/crawler/src/Tieba/Crawl/Facade/ThreadCrawlFacade.cs index 327b1306..71f3e347 100644 --- a/c#/crawler/src/Tieba/Crawl/Facade/ThreadCrawlFacade.cs +++ b/c#/crawler/src/Tieba/Crawl/Facade/ThreadCrawlFacade.cs @@ -1,14 +1,14 @@ namespace tbm.Crawler.Tieba.Crawl.Facade; public class ThreadCrawlFacade( - ThreadCrawler.New crawlerFactory, - string forumName, - Fid fid, - IIndex locks, - ThreadParser postParser, - ThreadSaver.New postSaverFactory, - UserParser.New userParserFactory, - UserSaver.New userSaverFactory) + ThreadCrawler.New crawlerFactory, + string forumName, + Fid fid, + IIndex locks, + ThreadParser postParser, + ThreadSaver.New postSaverFactory, + UserParser.New userParserFactory, + UserSaver.New userSaverFactory) : CrawlFacade( crawlerFactory(forumName), fid, new(fid), locks[CrawlerLocks.Type.Thread], postParser, postSaverFactory.Invoke, diff --git a/c#/crawler/src/Tieba/Crawl/Saver/Post/PostSaver.cs b/c#/crawler/src/Tieba/Crawl/Saver/Post/PostSaver.cs index 8157def0..50b589c6 100644 --- a/c#/crawler/src/Tieba/Crawl/Saver/Post/PostSaver.cs +++ b/c#/crawler/src/Tieba/Crawl/Saver/Post/PostSaver.cs @@ -3,10 +3,10 @@ namespace tbm.Crawler.Tieba.Crawl.Saver.Post; public abstract class PostSaver( - ILogger> logger, - ConcurrentDictionary posts, - AuthorRevisionSaver.New authorRevisionSaverFactory, - PostType currentPostType) + ILogger> logger, + ConcurrentDictionary posts, + AuthorRevisionSaver.New authorRevisionSaverFactory, + PostType currentPostType) : SaverWithRevision(logger), IPostSaver where TPost : BasePost where TBaseRevision : BaseRevisionWithSplitting diff --git a/c#/crawler/src/Tieba/Crawl/Saver/Post/ReplySaver.cs b/c#/crawler/src/Tieba/Crawl/Saver/Post/ReplySaver.cs index 8bafbf07..19b27419 100644 --- a/c#/crawler/src/Tieba/Crawl/Saver/Post/ReplySaver.cs +++ b/c#/crawler/src/Tieba/Crawl/Saver/Post/ReplySaver.cs @@ -3,11 +3,11 @@ namespace tbm.Crawler.Tieba.Crawl.Saver.Post; public class ReplySaver( - ILogger logger, - ConcurrentDictionary posts, - ReplyContentImageSaver replyContentImageSaver, - ReplySignatureSaver replySignatureSaver, - AuthorRevisionSaver.New authorRevisionSaverFactory) + ILogger logger, + ConcurrentDictionary posts, + ReplyContentImageSaver replyContentImageSaver, + ReplySignatureSaver replySignatureSaver, + AuthorRevisionSaver.New authorRevisionSaverFactory) : PostSaver( logger, posts, authorRevisionSaverFactory, PostType.Reply) { diff --git a/c#/crawler/src/Tieba/Crawl/Saver/Post/SubReplySaver.cs b/c#/crawler/src/Tieba/Crawl/Saver/Post/SubReplySaver.cs index 4a78c531..de2b68c0 100644 --- a/c#/crawler/src/Tieba/Crawl/Saver/Post/SubReplySaver.cs +++ b/c#/crawler/src/Tieba/Crawl/Saver/Post/SubReplySaver.cs @@ -3,9 +3,9 @@ namespace tbm.Crawler.Tieba.Crawl.Saver.Post; public class SubReplySaver( - ILogger logger, - ConcurrentDictionary posts, - AuthorRevisionSaver.New authorRevisionSaverFactory) + ILogger logger, + ConcurrentDictionary posts, + AuthorRevisionSaver.New authorRevisionSaverFactory) : PostSaver( logger, posts, authorRevisionSaverFactory, PostType.SubReply) { diff --git a/c#/crawler/src/Tieba/Crawl/Saver/Post/ThreadSaver.cs b/c#/crawler/src/Tieba/Crawl/Saver/Post/ThreadSaver.cs index 90741e0b..8575afc9 100644 --- a/c#/crawler/src/Tieba/Crawl/Saver/Post/ThreadSaver.cs +++ b/c#/crawler/src/Tieba/Crawl/Saver/Post/ThreadSaver.cs @@ -3,9 +3,9 @@ namespace tbm.Crawler.Tieba.Crawl.Saver.Post; public class ThreadSaver( - ILogger logger, - ConcurrentDictionary posts, - AuthorRevisionSaver.New authorRevisionSaverFactory) + ILogger logger, + ConcurrentDictionary posts, + AuthorRevisionSaver.New authorRevisionSaverFactory) : PostSaver( logger, posts, authorRevisionSaverFactory, PostType.Thread) { diff --git a/c#/crawler/src/Worker/ArchiveCrawlWorker.cs b/c#/crawler/src/Worker/ArchiveCrawlWorker.cs index 37728aaf..56c88c76 100644 --- a/c#/crawler/src/Worker/ArchiveCrawlWorker.cs +++ b/c#/crawler/src/Worker/ArchiveCrawlWorker.cs @@ -6,12 +6,12 @@ namespace tbm.Crawler.Worker; using SavedRepliesKeyByTid = ConcurrentDictionary>; public class ArchiveCrawlWorker( - ILogger logger, - Func> threadLateCrawlFacadeFactory, - Func> threadArchiveCrawlerFactory, - Func> threadArchiveCrawlFacadeFactory, - Func> replyCrawlFacadeFactory, - Func> subReplyCrawlFacadeFactory) + ILogger logger, + Func> threadLateCrawlFacadeFactory, + Func> threadArchiveCrawlerFactory, + Func> threadArchiveCrawlFacadeFactory, + Func> replyCrawlFacadeFactory, + Func> subReplyCrawlFacadeFactory) : ErrorableWorker(shouldExitOnException: true, shouldExitOnFinish: true) { // as of March 2019, tieba had restrict the max accepted value for page param of forum's threads api diff --git a/c#/crawler/src/Worker/MainCrawlWorker.cs b/c#/crawler/src/Worker/MainCrawlWorker.cs index af0809f8..d1ca1723 100644 --- a/c#/crawler/src/Worker/MainCrawlWorker.cs +++ b/c#/crawler/src/Worker/MainCrawlWorker.cs @@ -3,8 +3,8 @@ namespace tbm.Crawler.Worker; public class MainCrawlWorker( - Func> dbContextDefaultFactory, - CrawlPost crawlPost) + Func> dbContextDefaultFactory, + CrawlPost crawlPost) : CyclicCrawlWorker { protected override async Task DoWork(CancellationToken stoppingToken) diff --git a/c#/crawler/src/Worker/PushAllPostContentsIntoSonicWorker.cs b/c#/crawler/src/Worker/PushAllPostContentsIntoSonicWorker.cs index 40e1aba6..81dc1c74 100644 --- a/c#/crawler/src/Worker/PushAllPostContentsIntoSonicWorker.cs +++ b/c#/crawler/src/Worker/PushAllPostContentsIntoSonicWorker.cs @@ -4,11 +4,11 @@ namespace tbm.Crawler.Worker; // ReSharper disable once UnusedType.Global public class PushAllPostContentsIntoSonicWorker( - ILogger logger, - IConfiguration config, - SonicPusher pusher, - Func> dbContextFactory, - Func> dbContextDefaultFactory) + ILogger logger, + IConfiguration config, + SonicPusher pusher, + Func> dbContextFactory, + Func> dbContextDefaultFactory) : ErrorableWorker(shouldExitOnException: true, shouldExitOnFinish: true) { private readonly IConfiguration _config = config.GetSection("Sonic"); diff --git a/c#/crawler/src/Worker/ResumeSuspendPostContentsPushingWorker.cs b/c#/crawler/src/Worker/ResumeSuspendPostContentsPushingWorker.cs index 6227141b..6e903c2b 100644 --- a/c#/crawler/src/Worker/ResumeSuspendPostContentsPushingWorker.cs +++ b/c#/crawler/src/Worker/ResumeSuspendPostContentsPushingWorker.cs @@ -1,8 +1,8 @@ namespace tbm.Crawler.Worker; public class ResumeSuspendPostContentsPushingWorker( - ILogger logger, - SonicPusher pusher) + ILogger logger, + SonicPusher pusher) : ErrorableWorker { public static string GetFilePath(string postType) => diff --git a/c#/crawler/src/Worker/RetryCrawlWorker.cs b/c#/crawler/src/Worker/RetryCrawlWorker.cs index 20d92b0b..6ba72f28 100644 --- a/c#/crawler/src/Worker/RetryCrawlWorker.cs +++ b/c#/crawler/src/Worker/RetryCrawlWorker.cs @@ -1,14 +1,14 @@ namespace tbm.Crawler.Worker; public class RetryCrawlWorker( - ILogger logger, - IIndex registeredLocksLookup, - CrawlPost crawlPost, - Func> dbContextDefaultFactory, - Func> threadLateCrawlFacadeFactory, - Func> threadCrawlFacadeFactory, - Func> replyCrawlFacadeFactory, - Func> subReplyCrawlFacadeFactory) + ILogger logger, + IIndex registeredLocksLookup, + CrawlPost crawlPost, + Func> dbContextDefaultFactory, + Func> threadLateCrawlFacadeFactory, + Func> threadCrawlFacadeFactory, + Func> replyCrawlFacadeFactory, + Func> subReplyCrawlFacadeFactory) : CyclicCrawlWorker { protected override async Task DoWork(CancellationToken stoppingToken) diff --git a/c#/imagePipeline/src/Consumer/OcrConsumer.cs b/c#/imagePipeline/src/Consumer/OcrConsumer.cs index a07cce56..9f48b89f 100644 --- a/c#/imagePipeline/src/Consumer/OcrConsumer.cs +++ b/c#/imagePipeline/src/Consumer/OcrConsumer.cs @@ -1,9 +1,9 @@ namespace tbm.ImagePipeline.Consumer; public class OcrConsumer( - JointRecognizer.New recognizerFactory, - FailedImageHandler failedImageHandler, - string script) + JointRecognizer.New recognizerFactory, + FailedImageHandler failedImageHandler, + string script) : MatrixConsumer { private readonly JointRecognizer _recognizer = recognizerFactory(script); diff --git a/c#/imagePipeline/src/ImageBatchConsumingWorker.cs b/c#/imagePipeline/src/ImageBatchConsumingWorker.cs index da9ce333..6ef513bd 100644 --- a/c#/imagePipeline/src/ImageBatchConsumingWorker.cs +++ b/c#/imagePipeline/src/ImageBatchConsumingWorker.cs @@ -7,13 +7,13 @@ namespace tbm.ImagePipeline; public class ImageBatchConsumingWorker( - ILogger logger, - ILifetimeScope scope0, + ILogger logger, + ILifetimeScope scope0, - // ReSharper disable once SuggestBaseTypeForParameterInConstructor - Channel> channel, - Func> dbContextFactory, - Func> dbContextDefaultFactory) + // ReSharper disable once SuggestBaseTypeForParameterInConstructor + Channel> channel, + Func> dbContextFactory, + Func> dbContextDefaultFactory) : ErrorableWorker(shouldExitOnException: true, shouldExitOnFinish: true) { protected override async Task DoWork(CancellationToken stoppingToken) diff --git a/c#/imagePipeline/src/ImageBatchProducingWorker.cs b/c#/imagePipeline/src/ImageBatchProducingWorker.cs index bdbfe307..74cc68ee 100644 --- a/c#/imagePipeline/src/ImageBatchProducingWorker.cs +++ b/c#/imagePipeline/src/ImageBatchProducingWorker.cs @@ -1,13 +1,13 @@ namespace tbm.ImagePipeline; public class ImageBatchProducingWorker( - ILogger logger, - IConfiguration config, - ImageRequester imageRequester, + ILogger logger, + IConfiguration config, + ImageRequester imageRequester, - // ReSharper disable once SuggestBaseTypeForParameterInConstructor - Channel> channel, - Func> dbContextDefaultFactory) + // ReSharper disable once SuggestBaseTypeForParameterInConstructor + Channel> channel, + Func> dbContextDefaultFactory) : ErrorableWorker(shouldExitOnException: true) { private readonly IConfigurationSection _config = config.GetSection("ImageBatchProducer");