mirror of
https://github.com/elyby/accounts.git
synced 2024-12-23 22:00:06 +05:30
Increase cleanup timout for minecraft access tokens
This commit is contained in:
parent
29fc267148
commit
6c4ce8cb8d
@ -1,6 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
namespace console\controllers;
|
namespace console\controllers;
|
||||||
|
|
||||||
|
use Carbon\Carbon;
|
||||||
use common\models\AccountSession;
|
use common\models\AccountSession;
|
||||||
use common\models\EmailActivation;
|
use common\models\EmailActivation;
|
||||||
use common\models\MinecraftAccessKey;
|
use common\models\MinecraftAccessKey;
|
||||||
@ -32,7 +33,7 @@ class CleanupController extends Controller {
|
|||||||
|
|
||||||
public function actionMinecraftSessions(): int {
|
public function actionMinecraftSessions(): int {
|
||||||
$expiredMinecraftSessionsQuery = MinecraftAccessKey::find()
|
$expiredMinecraftSessionsQuery = MinecraftAccessKey::find()
|
||||||
->andWhere(['<', 'updated_at', time() - 1209600]); // 2 weeks
|
->andWhere(['<', 'updated_at', Carbon::now()->subMonths(3)->getTimestamp()]);
|
||||||
|
|
||||||
foreach ($expiredMinecraftSessionsQuery->each(100, Yii::$app->unbufferedDb) as $minecraftSession) {
|
foreach ($expiredMinecraftSessionsQuery->each(100, Yii::$app->unbufferedDb) as $minecraftSession) {
|
||||||
/** @var MinecraftAccessKey $minecraftSession */
|
/** @var MinecraftAccessKey $minecraftSession */
|
||||||
|
Loading…
Reference in New Issue
Block a user