J-Rios / TLG_JoinCaptchaBot

Telegram Bot to verify if users joining a group are human. The Bot sends an image captcha for each new user and kicks any of them who can't solve the captcha in a specified time.
GNU General Public License v3.0
515 stars 217 forks source link

[Bug] Low /time config took more time #141

Open bimbimprasetyoafif opened 2 years ago

bimbimprasetyoafif commented 2 years ago

Hello, i have set /time 10 sec But when my friend and i tried to not solve the captha, it take maybe less than 1 minute.

I not run on my local, i just add bot to my group

J-Rios commented 2 years ago

Checked on current running instances of both @join_captcha_bot and @pro_join_captcha_bot...

The issue just happen on @join_captcha_bot, maybe it could be some bug in "public-limited" branch...

J-Rios commented 2 years ago

This issue could be related to delay added by the Bot logic on handling time to kick users thread. This process for a high number of users being tracked at the same time (thousands or millions) needs a high intensive use of the CPU if we don't release this load a bit adding that delays.

Some changes has been done regarding this delays to reduce them and check if it helps to solve the issue of handling a very low kick time value when the Bot is handling a lot of users: https://github.com/J-Rios/TLG_JoinCaptchaBot/commit/dfe025e0f26aadf88655ed094934b25b631ae156

We will see if this change can be kept for current deployment machine or if we need to increase this delays again in the future (current CPU load before this change is ~15%)...

Regards.