mirror of
https://github.com/humhub/humhub.git
synced 2025-02-24 11:14:00 +01:00
#4225 Made module variable $cleanupPendingRegistrationInterval
This commit is contained in:
parent
17867ccfd1
commit
a1e9e221a5
@ -62,6 +62,11 @@ class Module extends \humhub\components\Module
|
||||
'https://platform.twitter.com/widgets.js'
|
||||
];
|
||||
|
||||
/**
|
||||
* @var int seconds before delete old pending registrations messages
|
||||
*/
|
||||
public $cleanupPendingRegistrationInterval = 60 * 60 * 24 * 90;
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
|
@ -8,6 +8,7 @@
|
||||
|
||||
namespace humhub\modules\admin\jobs;
|
||||
|
||||
use humhub\modules\admin\Module;
|
||||
use humhub\modules\queue\ActiveJob;
|
||||
use humhub\modules\user\models\Invite;
|
||||
use Yii;
|
||||
@ -20,18 +21,16 @@ use Yii;
|
||||
|
||||
class CleanupPendingRegistrations extends ActiveJob
|
||||
{
|
||||
/**
|
||||
* @var int seconds before delete old pending registrations messages
|
||||
*/
|
||||
public $cleanupInterval = 60 * 60 * 24 * 90;
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
* @throws \yii\base\InvalidConfigException
|
||||
*/
|
||||
public function run()
|
||||
{
|
||||
Invite::deleteAll(['<', 'created_at', Yii::$app->formatter->asDatetime(time() - $this->cleanupInterval, 'php:Y-m-d H:i:s')]);
|
||||
/** @var Module $module */
|
||||
$module = Yii::$app->getModule('admin');
|
||||
|
||||
Invite::deleteAll(['<', 'created_at', Yii::$app->formatter->asDatetime(time() - $module->cleanupPendingRegistrationInterval, 'php:Y-m-d H:i:s')]);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user