onQueue('lemmy-posts'); } public function handle(): void { if ($this->article->articlePublication !== null) { logger()->info('Article already published, skipping', [ 'article_id' => $this->article->id ]); return; } $extractedData = ArticleFetcher::fetchArticleData($this->article); logger()->info('Publishing article to Lemmy', [ 'article_id' => $this->article->id, 'url' => $this->article->url ]); try { $publications = LemmyPublisher::fromActiveAccount()->publish($this->article, $extractedData); logger()->info('Article published successfully', [ 'article_id' => $this->article->id, 'publications_count' => $publications->count(), 'communities' => $publications->pluck('community_id')->toArray() ]); } catch (PublishException $e) { $this->fail($e); } catch (RuntimeException $e) { logger()->warning('No active Lemmy accounts configured', [ 'article_id' => $this->article->id, 'error' => $e->getMessage() ]); $this->fail($e); } } }