Remove redundant method

This commit is contained in:
Jake Barnby 2025-05-16 22:07:17 +12:00
parent d6fd05866a
commit 19d040d43d
No known key found for this signature in database
GPG key ID: C437A8CC85B96E9C

View file

@ -42,6 +42,7 @@ class Migrate extends Action
* @param callable(Document): Database $getProjectDB
* @param Registry $register
* @return void
* @throws Exception
*/
public function action(
string $version,
@ -58,18 +59,8 @@ class Migrate extends Action
return;
}
$this->redis = new Redis();
$this->redis->connect(
System::getEnv('_APP_REDIS_HOST', ''),
System::getEnv('_APP_REDIS_PORT', 6379),
3,
null,
10
);
Console::success('Starting Data Migration to version ' . $version);
$class = 'Appwrite\\Migration\\Version\\' . Migration::$versions[$version];
/** @var Migration $migration */
@ -98,22 +89,4 @@ class Migrate extends Action
Console::success('Migration completed');
}
private function clearProjectsCache(Document $project): void
{
try {
$iterator = null;
do {
$pattern = "default-cache-mariadb:_{$project->getInternalId()}:*";
$keys = $this->redis->scan($iterator, $pattern, 1000);
if ($keys !== false) {
foreach ($keys as $key) {
$this->redis->del($key);
}
}
} while ($iterator > 0);
} catch (\Throwable $th) {
Console::error('Failed to clear project ("' . $project->getId() . '") cache with error: ' . $th->getMessage());
}
}
}