@page "/queue/job/{id::guid:required}" @using System.Text.Json @using Iceshrimp.Backend.Core.Database.Tables @using Iceshrimp.Backend.Core.Extensions @using Iceshrimp.Backend.Core.Queues @model QueueJobModel @{ ViewData["title"] = "Job details - Iceshrimp.NET"; } @section head { } @section scripts { }

Queue Dashboard

Job details

@if (Model.Job.Status is not Job.JobStatus.Queued and not Job.JobStatus.Delayed) { if (Model.Job.WorkerId != null) { } } @if (Model.Job.Status is Job.JobStatus.Completed or Job.JobStatus.Failed) { } @if (Model.Job.Status == Job.JobStatus.Delayed) { } @if (Model.Job.RetryCount > 0) { } @if (Model.Job.ExceptionMessage != null) { } @if (Model.Job.ExceptionSource != null) { } @if (Model.Job.StackTrace != null) { }
ID @Model.Job.Id.ToStringLower()
Queue @Model.Job.Queue
Status @Model.Job.Status
Queued at @Model.Job.QueuedAt.ToDisplayStringTz()
Started at @(Model.Job.StartedAt?.ToDisplayStringTz() ?? "")
Worker ID @(Model.Job.WorkerId)
Finished at @(Model.Job.FinishedAt?.ToDisplayStringTz() ?? "")
Delayed until @(Model.Job.DelayedUntil?.ToDisplayStringTz() ?? "")
Duration @Model.Job.Duration.ToDurationDisplayString()
Queue duration @Model.Job.QueueDuration.ToDurationDisplayString()
Retry count @Model.Job.RetryCount
Exception message @Model.Job.ExceptionMessage
Exception source @Model.Job.ExceptionSource
Exception stack trace
@Model.Job.StackTrace

Job data

@{ if (Model.Job.Queue == "inbox") { var data = JsonSerializer.Deserialize(Model.Job.Data) ?? throw new Exception("Failed to deserialize inbox job data"); @if (data.InboxUserId != null || data.AuthenticatedUserId != null) { @if (data.InboxUserId != null) { } @if (data.AuthenticatedUserId != null) { }
Inbox user id @data.InboxUserId
Authenticated user id @data.AuthenticatedUserId
}

Body

var json = JsonSerializer.Serialize(JsonDocument.Parse(data.Body), new JsonSerializerOptions { WriteIndented = true });
@json
} else if (Model.Job.Queue == "deliver") { var data = JsonSerializer.Deserialize(Model.Job.Data) ?? throw new Exception("Failed to deserialize deliver job data");
Inbox URL @data.InboxUrl
Content type @data.ContentType
User ID @data.UserId
Recipient host @data.RecipientHost

Payload

var json = JsonSerializer.Serialize(JsonDocument.Parse(data.Payload), new JsonSerializerOptions { WriteIndented = true });
@json
} else if (Model.Job.Queue == "pre-deliver") { var data = JsonSerializer.Deserialize(Model.Job.Data) ?? throw new Exception("Failed to deserialize pre-deliver job data");
Actor ID @data.ActorId
Recipient IDs [@string.Join(", ", data.RecipientIds)]
Deliver to followers @data.DeliverToFollowers

Serialized activity

var json = JsonSerializer.Serialize(JsonDocument.Parse(data.SerializedActivity), new JsonSerializerOptions { WriteIndented = true });
@json
} else { var json = JsonSerializer.Serialize(JsonDocument.Parse(Model.Job.Data), new JsonSerializerOptions { WriteIndented = true });
@json
} }