X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=app%2FConsole%2FCommands%2FReevaluateChatCommand.php;h=d87179cf665c256b1f16c285ff115a141f72452d;hb=HEAD;hp=b289bd0bde84b9a36ae92c9a75196f96cc547497;hpb=fcc1fcade0bc2a8a50d7b85592fc1238c8c864a7;p=alttp.git diff --git a/app/Console/Commands/ReevaluateChatCommand.php b/app/Console/Commands/ReevaluateChatCommand.php index b289bd0..d87179c 100644 --- a/app/Console/Commands/ReevaluateChatCommand.php +++ b/app/Console/Commands/ReevaluateChatCommand.php @@ -32,12 +32,14 @@ class ReevaluateChatCommand extends Command { ChatLog::whereIn('type', ['chat', 'error']) ->where('banned', false) ->orderBy('created_at') - ->chunk(10000, function ($logs) use (&$good, &$bad) { + ->chunk(5000, function ($logs) use (&$good, &$bad) { foreach ($logs as $line) { try { $line->evaluate(); - $line->evaluated_at = now(); - $line->save(); + if ($line->isDirty()) { + $line->evaluated_at = now(); + $line->save(); + } ++$good; } catch (\Exception $e) { ++$bad;