Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sharding adapter #20

Merged
merged 5 commits into from
Sep 26, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fixed tests
  • Loading branch information
eldadfux committed Sep 25, 2022
commit 8f1bc1329a90facded0aada65037b24400ff7705
4 changes: 1 addition & 3 deletions src/Cache/Adapter/Sharding.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function save($key, $data)
*/
public function purge($key): bool
eldadfux marked this conversation as resolved.
Show resolved Hide resolved
{
return (bool) $this->getAdapter($key);
return (bool) $this->getAdapter($key)->purge($key);
}

/**
Expand All @@ -65,8 +65,6 @@ protected function getAdapter(string $key): Adapter
{
$hash = \crc32($key);
$index = $hash % \count($this->adapters);
eldadfux marked this conversation as resolved.
Show resolved Hide resolved
var_dump($key, $index);
var_dump('-------------');
return $this->adapters[$index];
}
}