mirror of
https://git.sr.ht/~tsileo/microblog.pub
synced 2024-11-15 03:04:28 +00:00
Tweak the tasks flow
This commit is contained in:
parent
ac5f349d0f
commit
13cee5dbae
3 changed files with 4 additions and 2 deletions
3
app.py
3
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)
|
||||
|
|
|
@ -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", {})
|
||||
|
|
1
tasks.py
1
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:
|
||||
|
|
Loading…
Reference in a new issue