Koed00 / django-q

A multiprocessing distributed task queue for Django
https://django-q.readthedocs.org
MIT License
1.83k stars 285 forks source link

with table django_q_task, how to periodically auto-delete old data record #705

Open flyly0755 opened 1 year ago

flyly0755 commented 1 year ago

I use database as broker, so with table django_q_task to store task info. But after some times, get so many data record, and how to periodically auto-delete old data record? how to config? with table django_q_task, i also have some doubt,
CREATE TABLE "public"."django_q_task" ( "name" varchar(100) COLLATE "pg_catalog"."default" NOT NULL, "func" varchar(256) COLLATE "pg_catalog"."default" NOT NULL, "hook" varchar(256) COLLATE "pg_catalog"."default", "args" text COLLATE "pg_catalog"."default", "kwargs" text COLLATE "pg_catalog"."default", "result" text COLLATE "pg_catalog"."default", "started" timestamptz(6) NOT NULL, "stopped" timestamptz(6) NOT NULL, "success" bool NOT NULL, "id" varchar(32) COLLATE "pg_catalog"."default" NOT NULL, "group" varchar(100) COLLATE "pg_catalog"."default", "attempt_count" int4 NOT NULL, CONSTRAINT "django_q_task_pkey" PRIMARY KEY ("id") how to understand field hook, result, success(with my table result, i got success value 't', what is this t means or; and result Null), is there any doc told how to use these fields?