Batch by item

This commit is contained in:
Carlos Fernandez 2026-07-11 17:30:17 -04:00
parent babd18c9a4
commit 562e67f7bf

View file

@ -334,17 +334,19 @@ export async function runMigrations() {
const batch = []; const batch = [];
for (const actor of game.actors) { for (const actor of game.actors) {
const updates = [];
for (const item of actor.items) { for (const item of actor.items) {
for (const effect of item.effects) { for (const effect of item.effects) {
const changes = handler.updateEffect(effect.toObject(), effect.parent); const changes = handler.updateEffect(effect.toObject(), effect.parent);
if (changes) { if (changes) updates.push(changes);
batch.push({ }
action: 'update', if (updates.length) {
documentName: 'ActiveEffect', batch.push({
updates: [changes], action: 'update',
parent: item documentName: 'ActiveEffect',
}); updates: [updates],
} parent: item
});
} }
} }
} }