Skip to content

Commit

Permalink
Defuse 7 second iteration.
Browse files Browse the repository at this point in the history
  • Loading branch information
Booster1212 committed May 6, 2022
1 parent c0be043 commit b8e519d
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions server/src/defaults/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,8 @@ import { farmingItems } from './farmingLists/farmingItems';
import { farmingTools } from './farmingLists/farmingTools';

const itemsToRegister = [...farmingItems, ...farmingTools];

for (const item of itemsToRegister) {
const factoryItem = await ItemFactory.get(item.dbName);
await ItemFactory.add(item);

if (!item || !item.version || !factoryItem || !factoryItem.version) continue;
if (item.version != factoryItem.version) {
await ItemFactory.update(factoryItem.dbName, item);
console.log(`Updated item ${item.name} new version => ${item.version}`);
}
}
for (let x = 0; x < itemsToRegister.length; x++) {
const item = itemsToRegister[x];
ItemFactory.add(item);
ItemFactory.update(item.dbName, item);
}

0 comments on commit b8e519d

Please sign in to comment.