From 13cee5dbaeb602b96e41454e71f8efda1a3f39d3 Mon Sep 17 00:00:00 2001 From: Thomas Sileo Date: Tue, 17 Jul 2018 23:46:12 +0200 Subject: [PATCH] Tweak the tasks flow --- app.py | 3 ++- config.py | 2 +- tasks.py | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app.py b/app.py index 44a0da1..54d15c4 100644 --- a/app.py +++ b/app.py @@ -80,9 +80,10 @@ back = activitypub.MicroblogPubBackend() def save_cb(box: Box, iri: str) -> None: - tasks.cache_attachments.delay(iri) if box == Box.INBOX: tasks.process_new_activity.delay(iri) + else: + tasks.cache_attachments.delay(iri) back.set_save_cb(save_cb) diff --git a/config.py b/config.py index 9031b52..855f85b 100644 --- a/config.py +++ b/config.py @@ -72,7 +72,7 @@ with open(os.path.join(KEY_DIR, "me.yml")) as f: PASS = conf["pass"] EXTRA_INBOXES = conf.get("extra_inboxes", []) - HIDE_FOLLOWING = strtobool(conf.get("hide_following", "false")) + HIDE_FOLLOWING = conf.get("hide_following", False) # Theme-related config theme_conf = conf.get("theme", {}) diff --git a/tasks.py b/tasks.py index 79a1d51..603a797 100644 --- a/tasks.py +++ b/tasks.py @@ -54,6 +54,7 @@ def process_new_activity(self, iri: str) -> None: ) log.info(f"new activity {iri} processed") + cache_attachments.delay(iri) except (ActivityGoneError, ActivityNotFoundError): log.exception(f"dropping activity {iri}") except Exception as err: