Update TransformImports command, increment status_count on profile model

This commit is contained in:
Daniel Supernault 2023-07-14 01:46:51 -06:00
parent 0b5157675f
commit ba7551d8a9
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

@ -9,6 +9,7 @@ use App\Media;
use App\Profile;
use App\Status;
use Storage;
use App\Services\AccountService;
use App\Services\MediaPathService;
use Illuminate\Support\Str;
use App\Util\Lexer\Autolink;
@ -38,7 +39,7 @@ class TransformImports extends Command
return;
}
$ips = ImportPost::whereNull('status_id')->where('skip_missing_media', '!=', true)->take(200)->get();
$ips = ImportPost::whereNull('status_id')->where('skip_missing_media', '!=', true)->take(500)->get();
if(!$ips->count()) {
return;
@ -135,6 +136,11 @@ class TransformImports extends Command
$ip->creation_id = $idk['incr'];
$ip->save();
$profile->status_count = $profile->status_count + 1;
$profile->save();
AccountService::del($profile->id);
ImportService::clearAttempts($profile->id);
ImportService::getPostCount($profile->id, true);
}