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
1 changed files with 7 additions and 1 deletions

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);
}