X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=app%2FConsole%2FCommands%2FReevaluateChatCommand.php;h=d87179cf665c256b1f16c285ff115a141f72452d;hb=1dea58cb6fa9cf28966e75c1e1af87f67e6c0fd1;hp=6080132a480423a3482e962b918327d073bb7dc8;hpb=f6408dcec11bb63eb1c996d73ebf5629335e25aa;p=alttp.git diff --git a/app/Console/Commands/ReevaluateChatCommand.php b/app/Console/Commands/ReevaluateChatCommand.php index 6080132..d87179c 100644 --- a/app/Console/Commands/ReevaluateChatCommand.php +++ b/app/Console/Commands/ReevaluateChatCommand.php @@ -29,15 +29,17 @@ class ReevaluateChatCommand extends Command { public function handle() { $good = 0; $bad = 0; - ChatLog::where('type', '=', 'chat') + 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;