nisnevich / discord-consensus-bot

A Discord bot for a consensus in decentralised organisations (e.g. DAO). Implements a lazy consensus and full consensus models.
MIT License
5 stars 4 forks source link

Prevent concurrent running of main process #4

Open nisnevich opened 1 year ago

nisnevich commented 1 year ago

Prevent the bot process from running if it already exists, otherwise it may lead to various concurrency errors. This should be checked both: 1) on OS side in startup script (using bash/pm2) 2) on discord side after the bot has already started (by token) - this is to verify there's no other PC where the bot runs under the same token.