#59 pages import: working version

This commit is contained in:
Hamid Reza Mohammadi 2021-01-07 15:59:22 +03:30
parent d921c3b45b
commit a59ccf33eb
2 changed files with 4 additions and 4 deletions

View File

@ -1055,7 +1055,7 @@ namespace RMuseum.Services.Implementation
}
await context.SaveChangesAsync();
job = (await jobProgressServiceEF.UpdateJob(job.Id, 50, "phase 2")).Result;
job = (await jobProgressServiceEF.UpdateJob(job.Id, 0, "phase 2")).Result;
var orphanPages = await context.GanjoorPages.Include(p => p.Poem).Where(p => p.FullUrl == null).ToListAsync();
@ -1064,7 +1064,7 @@ namespace RMuseum.Services.Implementation
foreach (var page in orphanPages)
{
job = (await jobProgressServiceEF.UpdateJob(job.Id, 50 + i / count * 100, "phase 2")).Result;
job = (await jobProgressServiceEF.UpdateJob(job.Id, i++, "phase 2")).Result;
string fullUrl = page.UrlSlug;
string fullTitle = page.Title;
@ -1094,7 +1094,7 @@ namespace RMuseum.Services.Implementation
fullUrl = cat.FullUrl;
while (cat.ParentId != null)
{
cat = await context.GanjoorCategories.Where(c => c.Id == cat.Id).SingleOrDefaultAsync();
cat = await context.GanjoorCategories.Where(c => c.Id == cat.ParentId).SingleOrDefaultAsync();
if (cat != null)
{
fullTitle = cat.Title + " » " + fullTitle;

View File

@ -54,7 +54,7 @@ namespace RSecurityBackend.Services.Implementation
{
try
{
var jobs = await _context.LongRunningJobs.Where(j => (succeeded || (!succeeded && j.Succeeded == false)) && (failed || (!failed && j.Exception != ""))).OrderByDescending(j => j.StartTime).ToArrayAsync();
var jobs = await _context.LongRunningJobs.Where(j => (succeeded || (!succeeded && j.Succeeded == false)) && (failed || (!failed && j.Exception == ""))).OrderByDescending(j => j.StartTime).ToArrayAsync();
return new RServiceResult<RLongRunningJobStatus[]>(jobs);
}