diff --git a/RMuseum/Services/Implementation/GanjoorService-Imports/GanjoorService-MySqlImports.cs b/RMuseum/Services/Implementation/GanjoorService-Imports/GanjoorService-MySqlImports.cs index 55a8f324..747b4d4e 100644 --- a/RMuseum/Services/Implementation/GanjoorService-Imports/GanjoorService-MySqlImports.cs +++ b/RMuseum/Services/Implementation/GanjoorService-Imports/GanjoorService-MySqlImports.cs @@ -41,8 +41,6 @@ namespace RMuseum.Services.Implementation var job = (await jobProgressServiceEF.NewJob("GanjoorService:ImportFromMySql", "pre open connection")).Result; - - MusicCatalogueService catalogueService = new MusicCatalogueService(Configuration, context); RServiceResult musicCatalogueRes = await catalogueService.ImportFromMySql("MusicCatalogueImportFromMySql", jobProgressServiceEF, job); @@ -354,19 +352,19 @@ namespace RMuseum.Services.Implementation await context.SaveChangesAsync(); - await jobProgressServiceEF.UpdateJob(job.Id, 100, "Finished", true); + } catch (Exception jobExp) { await jobProgressServiceEF.UpdateJob(job.Id, job.Progress, "", false, jobExp.ToString()); } - var resComments = await _ImportCommentsDataFromMySql("_ImportCommentsDataFromMySql", context, jobProgressServiceEF, job); if (!resComments.Result) { - return; } + + await jobProgressServiceEF.UpdateJob(job.Id, 100, "Finished", true); } }); @@ -531,7 +529,6 @@ namespace RMuseum.Services.Implementation context.GanjoorComments.Add(comment); - await context.SaveChangesAsync(); //keeping original order of comments by saving things here i++; @@ -543,6 +540,8 @@ namespace RMuseum.Services.Implementation } } + await context.SaveChangesAsync(); + } }