summaryrefslogtreecommitdiff
path: root/internal/federation/dereferencing
diff options
context:
space:
mode:
Diffstat (limited to 'internal/federation/dereferencing')
-rw-r--r--internal/federation/dereferencing/account.go9
-rw-r--r--internal/federation/dereferencing/dereferencer.go10
2 files changed, 15 insertions, 4 deletions
diff --git a/internal/federation/dereferencing/account.go b/internal/federation/dereferencing/account.go
index 10d15bca6..5e81fb445 100644
--- a/internal/federation/dereferencing/account.go
+++ b/internal/federation/dereferencing/account.go
@@ -64,8 +64,8 @@ func accountFresh(
return true
}
- if !account.SuspendedAt.IsZero() {
- // Can't refresh
+ if account.IsSuspended() {
+ // Can't/won't refresh
// suspended accounts.
return true
}
@@ -388,8 +388,9 @@ func (d *Dereferencer) enrichAccountSafely(
account *gtsmodel.Account,
accountable ap.Accountable,
) (*gtsmodel.Account, ap.Accountable, error) {
- // Noop if account has been suspended.
- if !account.SuspendedAt.IsZero() {
+ // Noop if account suspended;
+ // we don't want to deref it.
+ if account.IsSuspended() {
return account, nil, nil
}
diff --git a/internal/federation/dereferencing/dereferencer.go b/internal/federation/dereferencing/dereferencer.go
index 24e579408..3fa199345 100644
--- a/internal/federation/dereferencing/dereferencer.go
+++ b/internal/federation/dereferencing/dereferencer.go
@@ -64,6 +64,16 @@ var (
// This is tuned to be quite fresh without
// causing loads of dereferencing calls.
Fresh = util.Ptr(FreshnessWindow(5 * time.Minute))
+
+ // 10 seconds.
+ //
+ // Freshest is useful when you want an
+ // immediately up to date model of something
+ // that's even fresher than Fresh.
+ //
+ // Be careful using this one; it can cause
+ // lots of unnecessary traffic if used unwisely.
+ Freshest = util.Ptr(FreshnessWindow(10 * time.Second))
)
// Dereferencer wraps logic and functionality for doing dereferencing