Skip to content

Commit

Permalink
Fixed problem with wordlists not being updated in job after edit
Browse files Browse the repository at this point in the history
  • Loading branch information
openbullet committed Mar 9, 2022
1 parent 31051b8 commit 8d72464
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 7 additions & 1 deletion OpenBullet2.Core/Services/JobManagerService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;

namespace OpenBullet2.Core.Services
{
Expand Down Expand Up @@ -141,14 +142,19 @@ await recordRepo.Add(new RecordEntity
}
}

// Saves the options for a MultiRunJob in the IRecordRepository. Thread safe.
private async void SaveMultiRunJobOptions(object sender, EventArgs e)
{
if (sender is not MultiRunJob job)
{
return;
}

await SaveMultiRunJobOptions(job);
}

// Saves the options for a MultiRunJob in the IJobRepository. Thread safe.
public async Task SaveMultiRunJobOptions(MultiRunJob job)
{
await jobSemaphore.WaitAsync();

try
Expand Down
2 changes: 2 additions & 0 deletions OpenBullet2/Pages/Wordlists.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,8 @@ private async Task EditWordlist()
Id = selectedWordlist.Id,
Total = selectedWordlist.Total
});

await JobManager.SaveMultiRunJobOptions(job);
}
}
}
Expand Down

0 comments on commit 8d72464

Please sign in to comment.