Merge pull request #6177 from pixelfed/staging

Update InstanceService, fix total post count when config_cache is dis…
pull/6183/head
dansup 2 months ago committed by GitHub
commit cb0ab839ca
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -4,6 +4,7 @@
- Update Status storage, add SanitizerService to fix spacing in html stripped content ([3686c9212](https://github.com/pixelfed/pixelfed/commit/3686c9212))
- Update app config, add description and rule env variables ([0980519a9](https://github.com/pixelfed/pixelfed/commit/0980519a9))
- Update InstanceService, fix total post count when config_cache is disabled ([f0bc9d66e](https://github.com/pixelfed/pixelfed/commit/f0bc9d66e))
- ([](https://github.com/pixelfed/pixelfed/commit/))
## [v0.12.6 (2025-09-03)](https://github.com/pixelfed/pixelfed/compare/v0.12.6...dev)

@ -4,7 +4,8 @@ namespace App\Services;
use App\Instance;
use App\Util\Blurhash\Blurhash;
use Cache;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\DB;
class InstanceService
{
@ -100,7 +101,17 @@ class InstanceService
public static function totalLocalStatuses()
{
return config_cache('instance.stats.total_local_posts');
if (config('instance.enable_cc')) {
return config_cache('instance.stats.total_local_posts');
}
return Cache::remember(self::CACHE_KEY_TOTAL_POSTS, now()->addHour(), function () {
return DB::table('statuses')
->whereNull('deleted_at')
->where('local', true)
->whereNot('type', 'share')
->count();
});
}
public static function headerBlurhash()

Loading…
Cancel
Save