From d8d439e596a74a543519c032dbc7f17702c69a2f Mon Sep 17 00:00:00 2001 From: Ted Unangst Date: Tue, 21 May 2019 18:51:04 -0400 Subject: [PATCH] consume activities in a goroutine other than the web handler --- activity.go | 7 +++++++ honk.go | 5 +---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/activity.go b/activity.go index 9033bf2..d7803be 100644 --- a/activity.go +++ b/activity.go @@ -429,6 +429,13 @@ func newphone(a []string, obj map[string]interface{}) []string { return a } +func consumeactivity(user *WhatAbout, j interface{}, origin string) { + xonk := xonkxonk(user, j, origin) + if xonk != nil { + savexonk(user, xonk) + } +} + func xonkxonk(user *WhatAbout, item interface{}, origin string) *Honk { depth := 0 maxdepth := 4 diff --git a/honk.go b/honk.go index ef9b38f..5dba740 100644 --- a/honk.go +++ b/honk.go @@ -358,10 +358,7 @@ func inbox(w http.ResponseWriter, r *http.Request) { } } default: - xonk := xonkxonk(user, j, origin) - if xonk != nil { - savexonk(user, xonk) - } + go consumeactivity(user, j, origin) } }