X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;ds=sidebyside;f=app%2FConsole%2FCommands%2FChatlibDatabase.php;h=b95bb64a06a6dbec47b333c2c9248493e0c8492d;hb=a45648fa8ecf7712c7fd00eb2b93e862b5264f04;hp=bfe0135c4b8e00e684a9f2974faf862f447296fd;hpb=c2cc99020eee56f7790d1358abb44df078f2e655;p=alttp.git diff --git a/app/Console/Commands/ChatlibDatabase.php b/app/Console/Commands/ChatlibDatabase.php index bfe0135..b95bb64 100644 --- a/app/Console/Commands/ChatlibDatabase.php +++ b/app/Console/Commands/ChatlibDatabase.php @@ -34,6 +34,7 @@ class ChatlibDatabase extends Command { ChatLog::where('type', '=', 'chat') ->where('banned', '=', false) ->whereNotNull('evaluated_at') + ->where('created_at', '<', now()->sub(7, 'day')) ->chunk(5000, function ($msgs) use ($de, $en) { foreach ($msgs as $msg) { if ($msg->detected_language === 'de') { @@ -48,16 +49,10 @@ class ChatlibDatabase extends Command { }); $de->compile(); - $en->compile(); + $de->saveAs('de'); - $this->line(''); - for ($i = 0; $i < 50; ++$i) { - $this->line($de->generate()); - } - $this->line(''); - for ($i = 0; $i < 50; ++$i) { - $this->line($en->generate()); - } + $en->compile(); + $en->saveAs('en'); return 0; }