[backend/queue] JobData shouldn't inherit from Job
This commit is contained in:
parent
cdadb63e19
commit
f39479ca6b
3 changed files with 4 additions and 4 deletions
|
@ -198,7 +198,7 @@ public class BackgroundTaskQueue()
|
|||
[JsonDerivedType(typeof(DriveFileDeleteJobData), "driveFileDelete")]
|
||||
[JsonDerivedType(typeof(PollExpiryJobData), "pollExpiry")]
|
||||
[JsonDerivedType(typeof(MuteExpiryJobData), "muteExpiry")]
|
||||
public class BackgroundTaskJobData : Job;
|
||||
public abstract class BackgroundTaskJobData;
|
||||
|
||||
public class DriveFileDeleteJobData : BackgroundTaskJobData
|
||||
{
|
||||
|
|
|
@ -30,12 +30,12 @@ public class InboxQueue() : PostgresJobQueue<InboxJobData>("inbox", InboxQueuePr
|
|||
var apHandler = scope.GetRequiredService<ActivityPub.ActivityHandlerService>();
|
||||
var logger = scope.GetRequiredService<ILogger<InboxQueue>>();
|
||||
|
||||
logger.LogTrace("Preparation took {ms} ms", jobData.Duration);
|
||||
logger.LogTrace("Preparation took {ms} ms", job.Duration);
|
||||
await apHandler.PerformActivityAsync(activity, jobData.InboxUserId, jobData.AuthenticatedUserId);
|
||||
}
|
||||
}
|
||||
|
||||
public class InboxJobData : Job
|
||||
public class InboxJobData
|
||||
{
|
||||
[JR] [J("body")] public required string Body { get; set; }
|
||||
[JR] [J("inboxUserId")] public required string? InboxUserId { get; set; }
|
||||
|
|
|
@ -130,7 +130,7 @@ public class PreDeliverQueue()
|
|||
}
|
||||
}
|
||||
|
||||
public class PreDeliverJobData : Job
|
||||
public class PreDeliverJobData
|
||||
{
|
||||
[JR] [J("serializedActivity")] public required string SerializedActivity { get; set; }
|
||||
[JR] [J("actorId")] public required string ActorId { get; set; }
|
||||
|
|
Loading…
Add table
Reference in a new issue