Cache attachment one by one

This commit is contained in:
Thomas Sileo
2019-08-17 10:27:20 +02:00
parent f3dc4995f1
commit 51475b73d5
2 changed files with 31 additions and 10 deletions

View File

@@ -1,6 +1,8 @@
import os
from datetime import datetime
from datetime import timezone
from typing import Any
from typing import Dict
from poussetaches import PousseTaches
@@ -56,6 +58,10 @@ class Tasks:
def cache_attachments(iri: str) -> None:
p.push(iri, "/task/cache_attachments")
@staticmethod
def cache_attachment(attachment: Dict[str, Any], iri: str) -> None:
p.push({"iri": iri, "attachment": attachment}, "/task/cache_attachment")
@staticmethod
def finish_post_to_inbox(iri: str) -> None:
p.push(iri, "/task/finish_post_to_inbox")