mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 14:52:26 -05:00
[chore] Move DoOnce func wrapper to util (#2613)
This commit is contained in:
parent
6738fd5bb0
commit
7a7746701d
5 changed files with 36 additions and 16 deletions
|
|
@ -28,6 +28,7 @@ import (
|
|||
"github.com/superseriousbusiness/gotosocial/internal/id"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/log"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/media"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/util"
|
||||
)
|
||||
|
||||
func (d *Dereferencer) GetRemoteEmoji(ctx context.Context, requestingUsername string, remoteURL string, shortcode string, domain string, id string, emojiURI string, ai *media.AdditionalEmojiInfo, refresh bool) (*media.ProcessingEmoji, error) {
|
||||
|
|
@ -44,7 +45,7 @@ func (d *Dereferencer) GetRemoteEmoji(ctx context.Context, requestingUsername st
|
|||
|
||||
// Acquire lock for derefs map.
|
||||
unlock := d.state.FedLocks.Lock(remoteURL)
|
||||
unlock = doOnce(unlock)
|
||||
unlock = util.DoOnce(unlock)
|
||||
defer unlock()
|
||||
|
||||
// first check if we're already processing this emoji
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue