Move account_storage_reconcile flag to config/scheduledtasks.php

Introduce a dedicated config/scheduledtasks.php for scheduled-task toggles
and relocate the reconciler flag there (ACCOUNT_STORAGE_RECONCILE), reading
it via config() in routes/scheduledtasks.php. Removed the setting from
config/pixelfed.php. Verified both states with schedule:list.
pull/7175/head
Your Name 2 weeks ago
parent 61c087e560
commit 219ce0ca2b

@ -69,19 +69,6 @@ return [
*/
'max_account_size' => env('MAX_ACCOUNT_SIZE', 1000000),
/*
|--------------------------------------------------------------------------
| Account storage reconciler
|--------------------------------------------------------------------------
|
| Optional weekly scheduled task that recalculates users.storage_used from
| actual media, correcting drift on accounts that never upload or delete.
| The upload/delete/read paths already self-heal stale counters, so this is
| a background hygiene job and is disabled by default.
|
*/
'account_storage_reconcile' => env('ACCOUNT_STORAGE_RECONCILE', false),
/*
|--------------------------------------------------------------------------
| Photo file size limit

@ -0,0 +1,24 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Scheduled Task Settings
|--------------------------------------------------------------------------
|
| Toggles for optional scheduled tasks defined in routes/scheduledtasks.php.
|
*/
/*
| Account storage reconciler
|
| Optional weekly scheduled task that recalculates users.storage_used from
| actual media, correcting drift on accounts that never upload or delete.
| The upload/delete/read paths already self-heal stale counters, so this is
| a background hygiene job and is disabled by default.
*/
'account_storage_reconcile' => env('ACCOUNT_STORAGE_RECONCILE', false),
];

@ -48,7 +48,10 @@ $schedule->command('app:notification-epoch-update')->weeklyOn(1, '2:21')->onOneS
$schedule->command('app:hashtag-cached-count-update')->hourlyAt(25)->onOneServer();
$schedule->command('app:account-post-count-stat-update')->everySixHours(25)->onOneServer();
if ((bool) config_cache('pixelfed.account_storage_reconcile')) {
if ((bool) config('scheduledtasks.account_storage_reconcile')) {
// Optional drift reconciler. The upload/delete/read paths already
// self-heal stale storage_used counters, so this is disabled by
// default and only needed to tidy accounts that never upload/delete.
$schedule->command('user:storage:recalculate --stale=168')->weeklyOn(3, '3:30')->onOneServer()->withoutOverlapping(1440);
}

Loading…
Cancel
Save