Remove minecraft_access_keys table and all related code

This commit is contained in:
ErickSkrauch
2024-06-14 05:42:35 +02:00
parent 2111e1769f
commit 0c110213f4
21 changed files with 69 additions and 321 deletions

View File

@@ -1,10 +1,8 @@
<?php
namespace console\controllers;
use Carbon\Carbon;
use common\models\AccountSession;
use common\models\EmailActivation;
use common\models\MinecraftAccessKey;
use common\models\OauthClient;
use common\tasks\ClearOauthSessions;
use Yii;
@@ -31,18 +29,6 @@ class CleanupController extends Controller {
return ExitCode::OK;
}
public function actionMinecraftSessions(): int {
$expiredMinecraftSessionsQuery = MinecraftAccessKey::find()
->andWhere(['<', 'updated_at', Carbon::now()->subMonths(3)->getTimestamp()]);
foreach ($expiredMinecraftSessionsQuery->each(100, Yii::$app->unbufferedDb) as $minecraftSession) {
/** @var MinecraftAccessKey $minecraftSession */
$minecraftSession->delete();
}
return ExitCode::OK;
}
/**
* Sessions that have not been refreshed for 90 days and those
* that have not been refreshed since they were issued more than 2 weeks ago