mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-12-25 09:17:03 +00:00
Update command
This commit is contained in:
parent
896e6023bd
commit
6b92c64851
1 changed files with 7 additions and 3 deletions
|
@ -7,6 +7,7 @@ use App\Profile;
|
||||||
use App\User;
|
use App\User;
|
||||||
use App\Instance;
|
use App\Instance;
|
||||||
use App\Util\ActivityPub\Helpers;
|
use App\Util\ActivityPub\Helpers;
|
||||||
|
use Symfony\Component\HttpKernel\Exception\HttpException;
|
||||||
|
|
||||||
class SendUpdateActor extends Command
|
class SendUpdateActor extends Command
|
||||||
{
|
{
|
||||||
|
@ -75,15 +76,18 @@ class SendUpdateActor extends Command
|
||||||
$this->info('Found sharedInbox: ' . $url);
|
$this->info('Found sharedInbox: ' . $url);
|
||||||
$bar = $this->output->createProgressBar($totalUserCount);
|
$bar = $this->output->createProgressBar($totalUserCount);
|
||||||
$bar->start();
|
$bar->start();
|
||||||
User::chunk(50, function($users) use($bar, $url) {
|
User::whereNull('status')->chunk(50, function($users) use($bar, $url) {
|
||||||
foreach($users as $user) {
|
foreach($users as $user) {
|
||||||
$profile = Profile::find($user->profile_id);
|
$profile = Profile::find($user->profile_id);
|
||||||
if(!$profile) {
|
if(!$profile) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$body = $this->updateObject($profile);
|
$body = $this->updateObject($profile);
|
||||||
Helpers::sendSignedObject($profile, $url, $body);
|
try {
|
||||||
usleep(500);
|
Helpers::sendSignedObject($profile, $url, $body);
|
||||||
|
} catch (HttpException $e) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
$bar->advance();
|
$bar->advance();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue