Merge pull request #1298 from pixelfed/frontend-ui-refactor

Update command
pull/1304/head
daniel 2019-05-13 01:10:08 -06:00 zatwierdzone przez GitHub
commit 56d61bc074
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 13 dodań i 8 usunięć

Wyświetl plik

@ -40,19 +40,24 @@ class SeedFollows extends Command
*/
public function handle()
{
$limit = 10000;
$limit = 100;
for ($i = 0; $i < $limit; $i++) {
try {
$actor = Profile::inRandomOrder()->firstOrFail();
$target = Profile::inRandomOrder()->firstOrFail();
$actor = Profile::whereDomain(false)->inRandomOrder()->firstOrFail();
$target = Profile::whereDomain(false)->inRandomOrder()->firstOrFail();
$follow = new Follower();
$follow->profile_id = $actor->id;
$follow->following_id = $target->id;
$follow->save();
if($actor->id == $target->id) {
continue;
}
$follow = Follower::firstOrCreate([
'profile_id' => $actor->id,
'following_id' => $target->id
]);
if($follow->wasRecentlyCreated == true) {
FollowPipeline::dispatch($follow);
}
} catch (Exception $e) {
continue;
}