Unverified Commit a82a421e authored by Armando Lüscher's avatar Armando Lüscher Committed by GitHub

Merge branch 'develop' into credits

parents a0de02df 56298a17
......@@ -6,6 +6,7 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c
## [Unreleased]
### Added
### Changed
- Add debug log entry instead of throwing an exception for duplicate updates.
### Deprecated
### Removed
### Fixed
......
......@@ -492,10 +492,6 @@ class DB
$update_id = $update->getUpdateId();
$update_type = $update->getUpdateType();
if (count(self::selectTelegramUpdate(1, $update_id)) === 1) {
throw new TelegramException('Duplicate update received!');
}
// @todo Make this simpler: if ($message = $update->getMessage()) ...
if ($update_type === 'message') {
$message = $update->getMessage();
......
......@@ -457,6 +457,12 @@ class Telegram
//This is necessary to "require" all the necessary command files!
$this->getCommandsList();
//Make sure we don't try to process update that was already processed
if (count(DB::selectTelegramUpdate(1, $this->update->getUpdateId())) === 1) {
TelegramLog::debug('Duplicate update received, processing aborted!');
return Request::emptyResponse();
}
DB::insertRequest($this->update);
return $this->executeCommand($command);
......
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