Added the ability to force updates
This commit is contained in:
parent
11a8032d36
commit
4380bb68ea
|
@ -125,12 +125,12 @@
|
|||
* @throws CannotUpdateChatMembersCacheException
|
||||
* @throws DatabaseException
|
||||
*/
|
||||
public function getChatMemberCache(Chat $chat): ChatMemberCache
|
||||
public function getChatMemberCache(Chat $chat, bool $force_update=True): ChatMemberCache
|
||||
{
|
||||
try
|
||||
{
|
||||
$returnResults = $this->getRecord($chat->getId());
|
||||
if((time() - $returnResults->LastUpdatedTimestamp) < 300)
|
||||
if((time() - $returnResults->LastUpdatedTimestamp) < 300 && $force_update == false)
|
||||
return $returnResults;
|
||||
$needsUpdate = true;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue