From 424a1f6ac647a8d02339902c6ff068f3487cd947 Mon Sep 17 00:00:00 2001 From: Demis Bellot Date: Mon, 19 Aug 2024 11:59:43 +0800 Subject: [PATCH] Update ImportQuestionCommand.cs --- MyApp.ServiceInterface/App/ImportQuestionCommand.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/MyApp.ServiceInterface/App/ImportQuestionCommand.cs b/MyApp.ServiceInterface/App/ImportQuestionCommand.cs index 5eab82b..0976baf 100644 --- a/MyApp.ServiceInterface/App/ImportQuestionCommand.cs +++ b/MyApp.ServiceInterface/App/ImportQuestionCommand.cs @@ -9,7 +9,7 @@ namespace MyApp.ServiceInterface.App; [Tag(Tags.Questions)] [Worker(Databases.App)] -public class ImportQuestionCommand(ILogger log, AppConfig appConfig) : IAsyncCommand +public class ImportQuestionCommand(ILogger log, AppConfig appConfig) : AsyncCommand { static readonly Regex ValidTagCharsRegex = new("[^a-zA-Z0-9#+.]", RegexOptions.Compiled); static readonly Regex SingleWhiteSpaceRegex = new(@"\s+", RegexOptions.Multiline | RegexOptions.Compiled); @@ -31,9 +31,8 @@ public class ImportQuestionCommand(ILogger log, AppConfig public AskQuestion? Result { get; set; } - public async Task ExecuteAsync(ImportQuestion request) + protected override async Task RunAsync(ImportQuestion request, CancellationToken token) { - CancellationToken token = new(); if (string.IsNullOrEmpty(request.Url)) throw new ArgumentNullException(nameof(request.Url));