diff options
author | FChannel <=> | 2021-01-28 12:31:44 -0800 |
---|---|---|
committer | FChannel <=> | 2021-01-28 12:31:44 -0800 |
commit | ee3c47a5b2251380ded1239b149fd1f6e6514bfb (patch) | |
tree | 4464e74060f84e47ef19a8449cdce02f4307ee0f /Follow.go | |
parent | faee9db270a22a42e45210529c7998dcede0087b (diff) |
dont write to cache if local actor
Diffstat (limited to 'Follow.go')
-rw-r--r-- | Follow.go | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -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) |