Skip to content

Commit

Permalink
Update offsetExists Function to Use Async Cache Check
Browse files Browse the repository at this point in the history
  • Loading branch information
valzargaming committed Nov 19, 2024
1 parent 6fbb669 commit e037994
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Discord/Repository/AbstractRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
use WeakReference;

use function Discord\nowait;

use function React\Async\await;
use function React\Promise\reject;
use function React\Promise\resolve;

Expand Down Expand Up @@ -659,7 +661,7 @@ public function keys(): array
*/
public function offsetExists($offset): bool
{
return parent::offsetExists($offset);
return await($this->cache->has($offset));
}

/**
Expand Down

0 comments on commit e037994

Please sign in to comment.