]> git.localhorst.tv Git - alttp.git/blobdiff - app/Console/Commands/ReevaluateChatCommand.php
add known bot
[alttp.git] / app / Console / Commands / ReevaluateChatCommand.php
index 6080132a480423a3482e962b918327d073bb7dc8..d87179cf665c256b1f16c285ff115a141f72452d 100644 (file)
@@ -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;