Added the ability to force updates

This commit is contained in:
Zi Xing 2021-12-25 18:59:39 -05:00
parent 11a8032d36
commit 4380bb68ea
1 changed files with 2 additions and 2 deletions

View File

@ -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;
}