From 7151acd8aaa003a9cc43da5fca4d39b23478d554 Mon Sep 17 00:00:00 2001 From: Hamid Reza Mohammadi Date: Sat, 5 Aug 2023 09:27:40 +0330 Subject: [PATCH] #402 some changes for better performance --- .../PDFLibraryService-SohaLibrary.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/RMuseum/Services/Implementation/PDFLibraryService-Partials/PDFLibraryService-SohaLibrary.cs b/RMuseum/Services/Implementation/PDFLibraryService-Partials/PDFLibraryService-SohaLibrary.cs index b4974e7a..fee1f63d 100644 --- a/RMuseum/Services/Implementation/PDFLibraryService-Partials/PDFLibraryService-SohaLibrary.cs +++ b/RMuseum/Services/Implementation/PDFLibraryService-Partials/PDFLibraryService-SohaLibrary.cs @@ -65,6 +65,10 @@ namespace RMuseum.Services.Implementation private async Task ImportSohaLibraryUrlAsync(string srcUrl, RMuseumDbContext context) { + var oldJobs = await context.ImportJobs.ToArrayAsync(); + context.RemoveRange(oldJobs); + await context.SaveChangesAsync(); + ImportJob job = new ImportJob() { JobType = JobType.Pdf, @@ -103,7 +107,7 @@ namespace RMuseum.Services.Implementation model.OriginalSourceUrl = srcUrl; model.BookScriptType = BookScriptType.Printed; model.Language = "فارسی"; - model.SkipUpload = false; + model.SkipUpload = true; string html = ""; using (var client = new HttpClient())