Skip to content

Commit

Permalink
chore: will only wait 3s for lavalink in dev env
Browse files Browse the repository at this point in the history
  • Loading branch information
rofe-dl committed Feb 17, 2023
1 parent f1b4504 commit 1734c3c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: '3.8'
services:
tamashi-bot:
build: ./
image: rofedl/tamashi:1.2.0
image: rofedl/tamashi:1.2.1
ports:
- 8080:8080
depends_on:
Expand Down
6 changes: 4 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,10 @@ async function initClient(client) {
initCommands(client);
initShoukaku(client);

// gives some for lavalink server to start and download plugins if necessary
await new Promise((resolve) => setTimeout(resolve, 20 * 1000));
// gives some for lavalink server to start and download plugins if necessary in 'prod' environment
await new Promise((resolve) =>
setTimeout(resolve, process.env.NODE_ENV === 'dev' ? 2 * 1000 : 20 * 1000)
);

// triggers client.on('ready') and client.shoukaku.on('ready')
client.login(BOT_TOKEN);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tamashi",
"version": "1.2.0",
"version": "1.2.1",
"description": "A Discord bot",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 1734c3c

Please sign in to comment.