Bugfixes
This commit is contained in:
parent
55ff15ff86
commit
5da27d9820
3 changed files with 14 additions and 2 deletions
|
@ -26,6 +26,7 @@ services:
|
|||
environment:
|
||||
- MICROBLOGPUB_AMQP_BROKER=pyamqp://guest@rmq//
|
||||
- MICROBLOGPUB_MONGODB_HOST=mongo:27017
|
||||
- MICROBLOGPUB_DEBUG=1
|
||||
mongo:
|
||||
image: "mongo:latest"
|
||||
rmq:
|
||||
|
|
13
tasks.py
13
tasks.py
|
@ -35,6 +35,17 @@ SigAuth = HTTPSigAuth(KEY)
|
|||
back = activitypub.MicroblogPubBackend()
|
||||
ap.use_backend(back)
|
||||
|
||||
|
||||
def save_cb(box: Box, iri: str) -> None:
|
||||
if box == Box.INBOX:
|
||||
process_new_activity.delay(iri)
|
||||
else:
|
||||
cache_actor.delay(iri)
|
||||
|
||||
|
||||
back.set_save_cb(save_cb)
|
||||
|
||||
|
||||
MY_PERSON = ap.Person(**ME)
|
||||
|
||||
|
||||
|
@ -327,7 +338,7 @@ def finish_post_to_outbox(self, iri: str) -> None:
|
|||
activity = ap.fetch_remote_activity(iri)
|
||||
log.info(f"activity={activity!r}")
|
||||
|
||||
if activity.has_type(ap.activitytype.delete):
|
||||
if activity.has_type(ap.ActivityType.DELETE):
|
||||
back.outbox_delete(MY_PERSON, activity)
|
||||
elif activity.has_type(ap.ActivityType.UPDATE):
|
||||
back.outbox_update(MY_PERSON, activity)
|
||||
|
|
|
@ -19,7 +19,7 @@ class Instance(object):
|
|||
def __init__(self, name, host_url, docker_url=None):
|
||||
self.host_url = host_url
|
||||
self.docker_url = docker_url or host_url
|
||||
self._create_delay = 12
|
||||
self._create_delay = 20
|
||||
with open(
|
||||
os.path.join(
|
||||
os.path.dirname(os.path.abspath(__file__)),
|
||||
|
|
Loading…
Reference in a new issue