Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
202 views
in Technique[技术] by (71.8m points)

node.js - Perform clean exit on sharded client discord.js

I have just started to try and shard my bot (I understand the number of guilds required for sharding) and Ive run into an issue. I used to have a clean exit that used

process.on("SIGINT", () => { /* some cleanup here */  })

However when I close the shard manager (subsequently closing all shards) this gets called but the shard manager force destroys the process before all the cleanup can be done. Is there a way to allow the shard to complete a cleanExit (like closing DBs and destroying the client) before it force destroys the shard process??

question from:https://stackoverflow.com/questions/65889959/perform-clean-exit-on-sharded-client-discord-js

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...