feat(backend): implement postgres job queue
This commit is contained in:
18
backend/jobs/admin.py
Normal file
18
backend/jobs/admin.py
Normal file
@@ -0,0 +1,18 @@
|
||||
from django.contrib import admin
|
||||
|
||||
from jobs.models import Job, JobEvent
|
||||
|
||||
|
||||
@admin.register(Job)
|
||||
class JobAdmin(admin.ModelAdmin):
|
||||
list_display = ("id", "type", "status", "priority", "attempts", "max_attempts", "locked_by", "available_at")
|
||||
list_filter = ("status", "type")
|
||||
search_fields = ("id", "type", "idempotency_key", "locked_by")
|
||||
readonly_fields = ("created_at", "updated_at", "finished_at")
|
||||
|
||||
|
||||
@admin.register(JobEvent)
|
||||
class JobEventAdmin(admin.ModelAdmin):
|
||||
list_display = ("id", "job", "type", "attempt", "worker_id", "created_at")
|
||||
list_filter = ("type",)
|
||||
search_fields = ("job__id", "worker_id", "message")
|
||||
Reference in New Issue
Block a user