mirror of
https://github.com/appwrite/appwrite
synced 2026-05-24 01:18:37 +00:00
fix(upgrade): fix migration stuck at "Starting Data Migration [...]"
The iterator was in the loop so it was always reset to null and the same data set to be scanned. For cases where this happened, the iterator was not empty, but the keys returned from the scan was empty. According to [redis](https://redis.io/docs/latest/commands/scan/#number-of-elements-returned-at-every-scan-call), this is expected behavior. > SCAN family functions do not guarantee that the number of elements returned per call are in a given range. The commands are also allowed to return zero elements, and the client should not consider the iteration complete as long as the returned cursor is not zero. As such, we must make sure we're using the new iterator returned to continue scanning the keys.
This commit is contained in:
parent
b5fad9f234
commit
a52626e5d3
1 changed files with 1 additions and 1 deletions
|
|
@ -43,8 +43,8 @@ class Migrate extends Action
|
|||
private function clearProjectsCache(Document $project)
|
||||
{
|
||||
try {
|
||||
$iterator = null;
|
||||
do {
|
||||
$iterator = null;
|
||||
$pattern = "default-cache-_{$project->getInternalId()}:*";
|
||||
$keys = $this->redis->scan($iterator, $pattern, 1000);
|
||||
if ($keys !== false) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue