mirror of
https://github.com/elyby/accounts.git
synced 2025-05-31 14:11:46 +05:30
Remove minecraft_access_keys table and all related code
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user