mirror of
https://git.pleroma.social/pleroma/relay.git
synced 2024-11-09 18:08:00 +00:00
optimize RelayDatabase.get_inbox
This commit is contained in:
parent
9369b598fa
commit
4ea6a040fb
|
@ -120,13 +120,13 @@ class RelayDatabase(dict):
|
|||
if domain.startswith('http'):
|
||||
domain = urlparse(domain).hostname
|
||||
|
||||
if domain not in self['relay-list']:
|
||||
if fail:
|
||||
raise KeyError(domain)
|
||||
inbox = self['relay-list'].get(domain)
|
||||
|
||||
return
|
||||
if inbox:
|
||||
return inbox
|
||||
|
||||
return self['relay-list'][domain]
|
||||
if fail:
|
||||
raise KeyError(domain)
|
||||
|
||||
|
||||
def add_inbox(self, inbox, followid=None, fail=False):
|
||||
|
|
Loading…
Reference in a new issue