Skip to content

Commit 1237b67

Browse files
committed
Updated client module
1 parent 992b8f6 commit 1237b67

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

‎collections_dissemination.go‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,17 @@ func (p P) disseminateToRemoteCollections(it vocab.Item, iris ...vocab.IRI) erro
6666
}
6767

6868
currentRetry := 0
69+
start := time.Now().UTC().Round(time.Microsecond)
70+
delay := time.Duration(0)
6971
state := retryFn(func(ctx context.Context) ssm.Fn {
7072
// NOTE(marius): we expect that the client has already been set up for being able to POST requests
7173
// to remote servers. This means that it has been constructed using a HTTP client that includes
7274
// an HTTP-Signature RoundTripper.
73-
defer func() { currentRetry += 1 }()
74-
ll := p.l.WithContext(lw.Ctx{"to": col, "retry": currentRetry})
75+
defer func() {
76+
currentRetry += 1
77+
delay = time.Now().UTC().Round(time.Microsecond).Sub(start)
78+
}()
79+
ll := p.l.WithContext(lw.Ctx{"to": col, "retry": currentRetry, "delay": delay.String()})
7580
if _, _, err := p.c.ToCollection(it, col); err != nil {
7681
ll.Warnf("Unable to disseminate activity %s", err)
7782
switch {

‎go.mod‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ require (
66
git.sr.ht/~mariusor/lw v0.0.0-20250325163623-1639f3fb0e0d
77
git.sr.ht/~mariusor/ssm v0.0.0-20260220115209-1adc83acc174
88
github.com/go-ap/activitypub v0.0.0-20260416122353-fb80985e153a
9-
github.com/go-ap/client v0.0.0-20260429115030-3ff80ccbeebb
9+
github.com/go-ap/client v0.0.0-20260501083906-fcb66a1d98cc
1010
github.com/go-ap/errors v0.0.0-20260208110149-e1b309365966
1111
github.com/go-ap/filters v0.0.0-20260416122840-724cb3c8974c
1212
github.com/go-ap/jsonld v0.0.0-20251216162253-e38fa664ea77

0 commit comments

Comments
 (0)