Unverified Commit ea05bd86 authored by Jack'lul's avatar Jack'lul Committed by Armando Lüscher

Update this to be better

parent bb0a5eee
...@@ -479,10 +479,14 @@ class DB ...@@ -479,10 +479,14 @@ class DB
*/ */
public static function insertRequest(Update $update) public static function insertRequest(Update $update)
{ {
if (!self::isDbConnected()) {
return false;
}
$update_id = $update->getUpdateId(); $update_id = $update->getUpdateId();
$update_type = $update->getUpdateType(); $update_type = $update->getUpdateType();
if (self::isDbConnected() && count(self::selectTelegramUpdate(1, $update->getUpdateId())) === 1) { if (count(self::selectTelegramUpdate(1, $update_id)) === 1) {
throw new TelegramException('Duplicate update received!'); throw new TelegramException('Duplicate update received!');
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment