forked from mirror/pixelfed
Update config, allow Beagle discover service to be disabled
This commit is contained in:
parent
13f77a0fc7
commit
de4ce3c83f
2 changed files with 9 additions and 0 deletions
|
@ -55,6 +55,10 @@ class BeagleService
|
|||
return [];
|
||||
}
|
||||
|
||||
if ((bool) config('instance.discover.beagle_api') == false) {
|
||||
return [];
|
||||
}
|
||||
|
||||
return Cache::remember(self::DISCOVER_CACHE_KEY, now()->addHours(6), function () {
|
||||
try {
|
||||
$res = Http::withOptions(['allow_redirects' => false])
|
||||
|
@ -92,6 +96,10 @@ class BeagleService
|
|||
return [];
|
||||
}
|
||||
|
||||
if ((bool) config('instance.discover.beagle_api') == false) {
|
||||
return [];
|
||||
}
|
||||
|
||||
return Cache::remember(self::DISCOVER_POSTS_CACHE_KEY, now()->addHours(1), function () {
|
||||
$posts = collect(self::getDiscover())
|
||||
->filter(function ($post) {
|
||||
|
|
|
@ -18,6 +18,7 @@ return [
|
|||
'tags' => [
|
||||
'is_public' => env('INSTANCE_PUBLIC_HASHTAGS', false),
|
||||
],
|
||||
'beagle_api' => env('PF_INSTANCE_USE_BEAGLE_API', true),
|
||||
],
|
||||
|
||||
'email' => env('INSTANCE_CONTACT_EMAIL'),
|
||||
|
|
Loading…
Reference in a new issue