Skip to content

Commit

Permalink
Make Jobs easier to run Ad-hoc by removing the IJobExecutionContext f…
Browse files Browse the repository at this point in the history
…rom Process()
  • Loading branch information
da3dsoul committed Jan 10, 2024
1 parent b8e483d commit d79657d
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Shoko.Server/Scheduling/Jobs/AniDB/AniDBGetFileJob.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public override QueueStateStruct Description
}
}

protected override async Task Process(IJobExecutionContext context)
public override async Task Process()
{
Logger.LogInformation("Get AniDB file info: {VideoLocalID}", VideoLocalID);

Expand Down
4 changes: 2 additions & 2 deletions Shoko.Server/Scheduling/Jobs/BaseJob.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ public async Task Execute(IJobExecutionContext context)
{
try
{
await Process(context);
await Process();
}
catch (Exception ex)
{
throw new JobExecutionException(msg: ex.Message, refireImmediately: false, cause: ex);
}
}

protected abstract Task Process(IJobExecutionContext context);
public abstract Task Process();

[XmlIgnore][JsonIgnore] protected readonly ILogger Logger;
[XmlIgnore][JsonIgnore] public abstract QueueStateStruct Description { get; }
Expand Down
2 changes: 1 addition & 1 deletion Shoko.Server/Scheduling/Jobs/Shoko/DiscoverFileJob.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public DiscoverFileJob(ILoggerFactory loggerFactory, ISettingsProvider settingsP

protected DiscoverFileJob() { }

protected override async Task Process(IJobExecutionContext context)
public override async Task Process()
{
// The flow has changed.
// Check for previous existence, merge info if needed
Expand Down
2 changes: 1 addition & 1 deletion Shoko.Server/Scheduling/Jobs/Shoko/HashFileJob.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public HashFileJob(ILoggerFactory loggerFactory, ISettingsProvider settingsProvi
protected HashFileJob() {
}

protected override async Task Process(IJobExecutionContext context)
public override async Task Process()
{
var (shouldSave, vlocal, vlocalplace, folder) = GetVideoLocal();
Exception e = null;
Expand Down

0 comments on commit d79657d

Please sign in to comment.