Merge branch 'bugfix/status-search-fallback' into 'develop'
Activity.Search: resolve status on DB Timeout Closes #2566 See merge request pleroma/pleroma!3507
This commit is contained in:
commit
7afabe1cc6
@ -15,6 +15,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||
|
||||
### Removed
|
||||
|
||||
## Unreleased-patch
|
||||
- Mastodon API: Activity Search fallbacks on status fetching after a DB Timeout/Error
|
||||
|
||||
## 2.4.0 - 2021-08-xx
|
||||
|
||||
### Changed
|
||||
|
@ -26,6 +26,7 @@ defmodule Pleroma.Activity.Search do
|
||||
:plain
|
||||
end
|
||||
|
||||
try do
|
||||
Activity
|
||||
|> Activity.with_preloaded_object()
|
||||
|> Activity.restrict_deactivated_users()
|
||||
@ -39,6 +40,9 @@ defmodule Pleroma.Activity.Search do
|
||||
:offset
|
||||
)
|
||||
|> maybe_fetch(user, search_query)
|
||||
rescue
|
||||
_ -> maybe_fetch([], user, search_query)
|
||||
end
|
||||
end
|
||||
|
||||
def maybe_restrict_author(query, %User{} = author) do
|
||||
|
Loading…
Reference in New Issue
Block a user