php-telegram-bot / laravel

Laravel package for PHP Telegram Bot Library
Other
168 stars 50 forks source link

log cycling #57

Open xxNpCxx opened 1 year ago

xxNpCxx commented 1 year ago

Hey! There is a problem i was found at TelegramFetchCommand.php

while (true) {

    $response = rescue(fn() => $bot->handleGetUpdates($options));

    if ($response !== null && ! $response->isOk()) {
        $this->error($response->getDescription());
    }

}

setting timeout option doesn't delay while response will be ok . It means if you lost connection with db for some time, you got error log cycling.

noplanman commented 1 year ago

@TiiFuchs Any thoughts? I'd need to dig in as I'm not familiar with this bit.

TiiFuchs commented 1 year ago

It means if you lost connection with db for some time, you got error log cycling.

Do you connect to a database yourself? Since Laravel handles database connections quite well and the laravel package uses the db handler from Laravel, I would assume that it keeps it alive or reconnects automatically.

@xxNpCxx Do you have a suggestion to fix your problem?