Skip to content

Commit f5d9ad4

Browse files
committed
Delete users data incrementally
1 parent ea0523f commit f5d9ad4

File tree

10 files changed

+935
-149
lines changed

10 files changed

+935
-149
lines changed

h/models/job.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
that really need Postgres transactionality should use this custom job queue.
2929
"""
3030

31+
from enum import Enum
32+
3133
from sqlalchemy import (
3234
Column,
3335
DateTime,
@@ -47,6 +49,11 @@
4749
class Job(Base):
4850
"""A job in the job queue."""
4951

52+
class JobName(str, Enum):
53+
SYNC_ANNOTATION = "sync_annotation"
54+
ANNOTATION_SLIM = "annotation_slim"
55+
PURGE_USER = "purge_user"
56+
5057
__tablename__ = "job"
5158

5259
__table_args__ = (Index("ix__job_priority_enqueued_at", "priority", "enqueued_at"),)

h/services/job_queue.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
from datetime import datetime, timedelta
2-
from enum import Enum
32

43
from sqlalchemy import and_, func, literal_column, select
54
from zope.sqlalchemy import mark_changed
@@ -15,10 +14,6 @@ class Priority:
1514

1615

1716
class JobQueueService:
18-
class JobName(str, Enum):
19-
SYNC_ANNOTATION = "sync_annotation"
20-
ANNOTATION_SLIM = "annotation_slim"
21-
2217
def __init__(self, db):
2318
self._db = db
2419

0 commit comments

Comments
 (0)