From 562e67f7bfff0dd4369f0ebe45e374f0b54cab1c Mon Sep 17 00:00:00 2001 From: Carlos Fernandez Date: Sat, 11 Jul 2026 17:30:17 -0400 Subject: [PATCH] Batch by item --- module/systemRegistration/migrations.mjs | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/module/systemRegistration/migrations.mjs b/module/systemRegistration/migrations.mjs index dbf4f395..9888a72b 100644 --- a/module/systemRegistration/migrations.mjs +++ b/module/systemRegistration/migrations.mjs @@ -334,17 +334,19 @@ export async function runMigrations() { const batch = []; for (const actor of game.actors) { + const updates = []; for (const item of actor.items) { for (const effect of item.effects) { const changes = handler.updateEffect(effect.toObject(), effect.parent); - if (changes) { - batch.push({ - action: 'update', - documentName: 'ActiveEffect', - updates: [changes], - parent: item - }); - } + if (changes) updates.push(changes); + } + if (updates.length) { + batch.push({ + action: 'update', + documentName: 'ActiveEffect', + updates: [updates], + parent: item + }); } } }