Skip to content

Commit

Permalink
build(Sharding): 📦️ Change totalShards count to "auto"
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefouch committed Feb 9, 2024
1 parent 97e2125 commit 1010ffb
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 23 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ const Logger = require('./src/utils/logger');
// }

const manager = new ShardingManager('./bot.js', {
totalShards: 2,
totalShards: 'auto',
// token: PRODUCTION ? process.env.DISCORD_TOKEN : process.env.BETA_DISCORD_TOKEN,
// execArgv: ['--trace-warnings'],
// shardArgs: ['--ansi', '--color'],
});

manager.on('shardCreate', shard => Logger.client(`Launched shard ${shard.id}`));
manager.on('shardCreate', shard => Logger.client(`🚀 Launched shard ${shard.id}`));

manager.spawn();
42 changes: 21 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"author": "Stefouch",
"license": "GPL-3.0-or-later",
"homepage": "https://stefouch.be/",
"main": "index.js",
"keywords": [
"year zero",
"year zero engine",
Expand Down Expand Up @@ -44,27 +45,6 @@
"bugs": {
"url": "https://github.com/Stefouch/sebedius-yearzero-discord-bot/issues"
},
"main": "bot.js",
"scripts": {
"prestart": "node register.js",
"start": "node .",
"lint": "eslint .",
"lint:fix": "eslint --ext .js --fix .",
"lines": "bash count-lines-of-code.sh",
"upd": "npm list -g --depth=0 & npm outdated -g & npm outdated & npx npm-check -u",
"husky:install": "npx husky install",
"test": "mocha ./test/*.test.js --exit",
"test:roll": "mocha ./test/roll.test.js --exit",
"test:table": "mocha ./test/table.test.js --exit",
"test:locale": "mocha ./test/locale.test.js --exit",
"test:client": "mocha ./test/client.test.js --exit",
"test:db": "mocha ./test/db.test.js --exit",
"precommit-msg": "devmoji -e --lint",
"pm2:watch": "pm2 start bot.js --watch & pm2 log",
"release": "gulp release",
"register": "node register.js",
"bump": "npm run lint:fix && gulp bump --r"
},
"pre-commit": [
"precommit-msg"
],
Expand Down Expand Up @@ -99,5 +79,25 @@
"semver": "^7.6.0",
"sinon": "^17.0.1",
"standard-version": "^9.5.0"
},
"scripts": {
"prestart": "node register.js",
"start": "node .",
"lint": "eslint .",
"lint:fix": "eslint --ext .js --fix .",
"lines": "bash count-lines-of-code.sh",
"upd": "npm list -g --depth=0 & npm outdated -g & npm outdated & npx npm-check -u",
"husky:install": "npx husky install",
"test": "mocha ./test/*.test.js --exit",
"test:roll": "mocha ./test/roll.test.js --exit",
"test:table": "mocha ./test/table.test.js --exit",
"test:locale": "mocha ./test/locale.test.js --exit",
"test:client": "mocha ./test/client.test.js --exit",
"test:db": "mocha ./test/db.test.js --exit",
"precommit-msg": "devmoji -e --lint",
"pm2:watch": "pm2 start bot.js --watch & pm2 log",
"release": "gulp release",
"register": "node register.js",
"bump": "npm run lint:fix && gulp bump --r"
}
}

0 comments on commit 1010ffb

Please sign in to comment.