File tree Expand file tree Collapse file tree 3 files changed +13
-0
lines changed
Expand file tree Collapse file tree 3 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -9,5 +9,9 @@ export default {
99 "expires_at" timestamptz NOT NULL,
1010 CONSTRAINT "dedupe_pk" PRIMARY KEY ("task_name", "dedupe_key")
1111 );
12+
13+ CREATE INDEX "graphile_worker_deduplication_expires_at_idx"
14+ ON "graphile_worker_deduplication" ("expires_at")
15+ ;
1216 ` ,
1317} satisfies MigrationExecutor ;
Original file line number Diff line number Diff line change @@ -135,6 +135,12 @@ export interface document_preflight_scripts {
135135 updated_at : Date ;
136136}
137137
138+ export interface graphile_worker_deduplication {
139+ dedupe_key : string ;
140+ expires_at : Date ;
141+ task_name : string ;
142+ }
143+
138144export interface migration {
139145 date : Date ;
140146 hash : string ;
@@ -441,6 +447,7 @@ export interface DBTables {
441447 document_collection_documents : document_collection_documents ;
442448 document_collections : document_collections ;
443449 document_preflight_scripts : document_preflight_scripts ;
450+ graphile_worker_deduplication : graphile_worker_deduplication ;
444451 migration : migration ;
445452 oidc_integrations : oidc_integrations ;
446453 organization_access_tokens : organization_access_tokens ;
Original file line number Diff line number Diff line change @@ -44,6 +44,8 @@ const modules = await Promise.all([
4444const crontab = `
4545 # Purge expired schema checks every Sunday at 10:00AM
4646 0 10 * * 0 purgeExpiredSchemaChecks
47+ # Every day at 3:00 AM
48+ 0 3 * * * purgeExpiredDedupeKeys
4749` ;
4850
4951const pg = await createPool ( env . postgres . connectionString ) ;
You can’t perform that action at this time.
0 commit comments