diff options
author | Andrew Godwin | 2022-11-06 21:30:07 -0700 |
---|---|---|
committer | Andrew Godwin | 2022-11-06 21:30:07 -0700 |
commit | fb6c409a9af5b8a686e977ee2251c359071e0ec3 (patch) | |
tree | 322469694585b766eb623b47955623b3e43c89b1 /miniq/models.py | |
parent | 0d5f7e7a891bec4b8af26c2d86d8be0209a3202d (diff) | |
download | takahe-fb6c409a9af5b8a686e977ee2251c359071e0ec3.tar.gz takahe-fb6c409a9af5b8a686e977ee2251c359071e0ec3.tar.bz2 takahe-fb6c409a9af5b8a686e977ee2251c359071e0ec3.zip |
Rework task system and fetching.
I can taste how close follow is to working.
Diffstat (limited to 'miniq/models.py')
-rw-r--r-- | miniq/models.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/miniq/models.py b/miniq/models.py index 996b482..24d311c 100644 --- a/miniq/models.py +++ b/miniq/models.py @@ -11,6 +11,9 @@ class Task(models.Model): class TypeChoices(models.TextChoices): identity_fetch = "identity_fetch" + inbox_item = "inbox_item" + follow_request = "follow_request" + follow_acknowledge = "follow_acknowledge" type = models.CharField(max_length=500, choices=TypeChoices.choices) priority = models.IntegerField(default=0) @@ -42,7 +45,7 @@ class Task(models.Model): return next_task @classmethod - def submit(cls, type, subject, payload=None, deduplicate=True): + def submit(cls, type, subject: str, payload=None, deduplicate=True): # Deduplication is done against tasks that have not started yet only, # and only on tasks without payloads if deduplicate and not payload: |