File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -492,10 +492,6 @@ public static function insertRequest(Update $update)
492
492
$ update_id = $ update ->getUpdateId ();
493
493
$ update_type = $ update ->getUpdateType ();
494
494
495
- if (count (self ::selectTelegramUpdate (1 , $ update_id )) === 1 ) {
496
- throw new TelegramException ('Duplicate update received! ' );
497
- }
498
-
499
495
// @todo Make this simpler: if ($message = $update->getMessage()) ...
500
496
if ($ update_type === 'message ' ) {
501
497
$ message = $ update ->getMessage ();
Original file line number Diff line number Diff line change @@ -457,6 +457,12 @@ public function processUpdate(Update $update)
457
457
//This is necessary to "require" all the necessary command files!
458
458
$ this ->getCommandsList ();
459
459
460
+ //Make sure we don't try to process update that was already processed
461
+ if (count (DB ::selectTelegramUpdate (1 , $ this ->update ->getUpdateId ())) === 1 ) {
462
+ TelegramLog::debug ('Duplicate update received, processing aborted! ' );
463
+ return Request::emptyResponse ();
464
+ }
465
+
460
466
DB ::insertRequest ($ this ->update );
461
467
462
468
return $ this ->executeCommand ($ command );
You can’t perform that action at this time.
0 commit comments