add timeout for axios response
This commit is contained in:
parent
b5bdc33f28
commit
d1c9687d17
@ -14,7 +14,9 @@ client.on('ready', () => {
|
|||||||
|
|
||||||
async function updateServerData() {
|
async function updateServerData() {
|
||||||
try {
|
try {
|
||||||
const { data } = await axios.get<any>(`${process.env.ECO_API_BASE || "https://eco.kamgames.xyz"}/info`);
|
const { data } = await axios.get<any>(`${process.env.ECO_API_BASE || "https://eco.kamgames.xyz"}/info`, {
|
||||||
|
timeout: 6000,
|
||||||
|
});
|
||||||
client.user?.setActivity({
|
client.user?.setActivity({
|
||||||
name: `${data.OnlinePlayers}/${data.TotalPlayers}`,
|
name: `${data.OnlinePlayers}/${data.TotalPlayers}`,
|
||||||
type: ActivityType.Playing
|
type: ActivityType.Playing
|
||||||
|
Loading…
x
Reference in New Issue
Block a user