Use laravel task scheduler
This commit is contained in:
@@ -16,7 +16,7 @@ class GenerateSitemap extends Command
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'sitemap:generate';
|
||||
protected $signature = 'app:generate-sitemap';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
|
||||
@@ -8,6 +8,7 @@ use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Facades\Crypt;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use Illuminate\Contracts\Encryption\DecryptException;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class SyncSubscriptionKeys extends Command
|
||||
{
|
||||
@@ -83,7 +84,10 @@ class SyncSubscriptionKeys extends Command
|
||||
->whereNotIn('subscription_key', $activeKeys)
|
||||
->chunk(100, function ($users) {
|
||||
foreach($users as $user) {
|
||||
$user->removeRole(UserRole::SUPPORTER);
|
||||
if ($user->hasRole(UserRole::SUPPORTER)) {
|
||||
Log::info("Removed Supporter Role from {$user->name}");
|
||||
$user->removeRole(UserRole::SUPPORTER);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -95,7 +99,10 @@ class SyncSubscriptionKeys extends Command
|
||||
->whereIn('subscription_key', $activeKeys)
|
||||
->chunk(100, function ($users) {
|
||||
foreach($users as $user) {
|
||||
$user->addRole(UserRole::SUPPORTER);
|
||||
if (!$user->hasRole(UserRole::SUPPORTER)) {
|
||||
Log::info("Added Supporter Role for {$user->name}");
|
||||
$user->addRole(UserRole::SUPPORTER);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user