Update StatusPipeline

This commit is contained in:
Daniel Supernault 2019-02-26 00:30:54 -07:00
parent b4f0d1586d
commit 7295b1b887
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7
2 changed files with 10 additions and 12 deletions

View file

@ -41,16 +41,6 @@ class NewStatusPipeline implements ShouldQueue
*/ */
public function handle() public function handle()
{ {
$status = $this->status; StatusEntityLexer::dispatch($this->status);
StatusEntityLexer::dispatch($status);
if(config('pixelfed.activitypub_enabled') == true) {
StatusActivityPubDeliver::dispatch($status);
}
// Cache::forever('post.'.$status->id, $status);
// $redis = Redis::connection();
// $redis->lpush(config('cache.prefix').':user.'.$status->profile_id.'.posts', $status->id);
} }
} }

View file

@ -75,7 +75,6 @@ class StatusEntityLexer implements ShouldQueue
public function storeEntities() public function storeEntities()
{ {
$this->storeHashtags(); $this->storeHashtags();
$this->storeMentions();
DB::transaction(function () { DB::transaction(function () {
$status = $this->status; $status = $this->status;
$status->rendered = nl2br($this->autolink); $status->rendered = nl2br($this->autolink);
@ -100,6 +99,7 @@ class StatusEntityLexer implements ShouldQueue
); );
}); });
} }
$this->storeMentions();
} }
public function storeMentions() public function storeMentions()
@ -123,5 +123,13 @@ class StatusEntityLexer implements ShouldQueue
MentionPipeline::dispatch($status, $m); MentionPipeline::dispatch($status, $m);
}); });
} }
$this->deliver();
}
public function deliver()
{
if(config('pixelfed.activitypub_enabled') == true) {
StatusActivityPubDeliver::dispatch($this->status);
}
} }
} }