mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 19:22:24 -05:00
[performance] Add dereference shortcuts to avoid making http calls to self (#430)
* update transport (controller) to allow shortcuts * go fmt * expose underlying sig transport to allow test sigs
This commit is contained in:
parent
4b4c935e02
commit
e63b653199
7 changed files with 114 additions and 22 deletions
|
|
@ -1749,8 +1749,8 @@ func GetSignatureForActivity(activity pub.Activity, pubKeyID string, privkey cry
|
|||
panic(err)
|
||||
}
|
||||
|
||||
// trigger the delivery function, which will trigger the 'do' function of the recorder above
|
||||
if err := tp.Deliver(context.Background(), bytes, destination); err != nil {
|
||||
// trigger the delivery function for the underlying signature transport, which will trigger the 'do' function of the recorder above
|
||||
if err := tp.SigTransport().Deliver(context.Background(), bytes, destination); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
|
|
@ -1781,8 +1781,8 @@ func GetSignatureForDereference(pubKeyID string, privkey crypto.PrivateKey, dest
|
|||
panic(err)
|
||||
}
|
||||
|
||||
// trigger the delivery function, which will trigger the 'do' function of the recorder above
|
||||
if _, err := tp.Dereference(context.Background(), destination); err != nil {
|
||||
// trigger the dereference function for the underlying signature transport, which will trigger the 'do' function of the recorder above
|
||||
if _, err := tp.SigTransport().Dereference(context.Background(), destination); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue