Laravel Vapor - New schedule tasks and commands for token expiration for new user and password reset

This commit is contained in:
Dillon Ngo
2024-10-09 13:13:28 +08:00
parent 7953de1f7d
commit 497666e582
4 changed files with 5 additions and 5 deletions
@@ -28,7 +28,7 @@ class NewUserRegistrationExpireCheckV2CommandJob implements ShouldQueue
foreach ($attempts as $attempt){
(new ExpiresEmailVerificationAttempt())->execute($attempt);
Log::info('NewUser Expired: '.$attempt->email.', '.$attempt->created_at);
Log::info('NewUser Expired: '.$attempt->id.', '.$attempt->created_at);
}
$end = new Carbon();
@@ -77,7 +77,7 @@ class GeneratePasswordResetLogic extends AbstractControllerLogic
$attempt = $this->generatesPasswordReset->execute($user);
// $this->passwordResetTokenExpiration::dispatch($attempt)->delay(now()->addHours(24)); // cief todo: to convert to schedule task
// $this->passwordResetTokenExpiration::dispatch($attempt)->delay(now()->addHours(24)); //converted to schedule task
$this->sendResetPasswordEmail::dispatch($user, $attempt);
return $this->response(['email' => $object->getEmail()]);
@@ -50,7 +50,7 @@ class GenerateEmailVerificationAttemptProcessor
$attempt = $this->generatesEmailVerificationAttempt->execute($user);
//$this->emailVerificationAttemptExpiration::dispatch($attempt)->delay(now()->addHours(48)); // cief todo: to convert to schedule task
//$this->emailVerificationAttemptExpiration::dispatch($attempt)->delay(now()->addHours(48)); //converted to schedule task
$this->sendUserVerificationEmail::dispatch($user, $attempt);
+2 -2
View File
@@ -39,11 +39,11 @@ class Kernel extends ConsoleKernel
->withoutOverlapping();
$schedule->command('password-reset-token-expriration-check-command')
->everyFiveMinutes()
->everySixHours()
->withoutOverlapping();
$schedule->command('new-user-registration-expire-check-command')
->everyFiveMinutes()
->everySixHours()
->withoutOverlapping();
if(env('APP_ENV') === 'production'){