From ee3c47a5b2251380ded1239b149fd1f6e6514bfb Mon Sep 17 00:00:00 2001 From: FChannel <=> Date: Thu, 28 Jan 2021 12:31:44 -0800 Subject: dont write to cache if local actor --- Follow.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'Follow.go') diff --git a/Follow.go b/Follow.go index 5fa1a15..f672449 100644 --- a/Follow.go +++ b/Follow.go @@ -199,11 +199,15 @@ func SetActorFollowingDB(db *sql.DB, activity Activity) Activity { if alreadyFollow { query = `delete from following where id=$1 and following=$2` activity.Summary = activity.Object.Actor.Id + " Unfollowing " + activity.Actor.Id - go DeleteActorCache(db, activity.Actor.Id) + if !IsActorLocal(db, activity.Actor.Id) { + go DeleteActorCache(db, activity.Actor.Id) + } } else { query = `insert into following (id, following) values ($1, $2)` activity.Summary = activity.Object.Actor.Id + " Following " + activity.Actor.Id - go WriteActorToCache(db, activity.Actor.Id) + if !IsActorLocal(db, activity.Actor.Id) { + go WriteActorToCache(db, activity.Actor.Id) + } } _, err := db.Exec(query, activity.Object.Actor.Id, activity.Actor.Id) -- cgit v1.2.3