feat: migrate all local emoji to cloud in one pass by default

Change --limit default to 0 (no limit) so the emoji migration processes
every local emoji in a single run instead of capping at 1000, and drop the
limit from the scheduled invocation. Avoids a multi-run window where
not-yet-migrated emoji resolve to missing cloud URLs.
pull/6960/head
Your Name 4 weeks ago
parent fa76e1014a
commit 979df6e39e

@ -20,7 +20,7 @@ class EmojiMoveStorageLocalToCloud extends Command
* @var string
*/
protected $signature = 'admin:EmojiMoveStorageLocalToCloud
{--limit=1000 : Max emoji rows to process this run}
{--limit=0 : Max emoji rows to process this run (0 = no limit, process all)}
{--dry-run : Report what would happen without copying or writing}
{--keep-local : Do not delete local files after verifying the cloud copy}
{--force : Skip confirmation prompts}';
@ -76,7 +76,7 @@ class EmojiMoveStorageLocalToCloud extends Command
$query = CustomEmoji::whereNull('uri')
->whereNotNull('media_path')
->orderByDesc('id')
->limit($limit);
->when($limit > 0, fn ($q) => $q->limit($limit));
$bar = $this->output->createProgressBar($query->count());
$bar->start();

@ -146,8 +146,8 @@ return Application::configure(basePath: dirname(__DIR__))
if ((bool) config_cache('pixelfed.cloud_storage') && (bool) config_cache('media.delete_local_after_cloud')) {
// Upload any local stragglers to cloud and GC verified local copies.
$schedule->command('admin:MediaMoveStorageLocalToCloud --force --limit=500')->hourlyAt(15);
// Same for local custom emoji.
$schedule->command('admin:EmojiMoveStorageLocalToCloud --force --limit=1000')->dailyAt('04:35');
// Same for local custom emoji (no limit: keep all emoji on cloud).
$schedule->command('admin:EmojiMoveStorageLocalToCloud --force')->dailyAt('04:35');
}
if (config('import.instagram.enabled')) {

Loading…
Cancel
Save