From b6ea062014caea9860203e4c972cd8fe4beb5a84 Mon Sep 17 00:00:00 2001 From: Graham Campbell Date: Sat, 28 Dec 2019 09:57:06 +0000 Subject: [PATCH] Update SegmentServiceProvider.php --- src/SegmentServiceProvider.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/SegmentServiceProvider.php b/src/SegmentServiceProvider.php index f3ddc7b..7adaf00 100644 --- a/src/SegmentServiceProvider.php +++ b/src/SegmentServiceProvider.php @@ -66,9 +66,11 @@ protected function setupConfig() */ protected function setupQueue() { - $this->app->queue->looping(function () { - Segment::flush(); - }); + if ($this->app->runningInConsole()) { + $this->app->queue->looping(function () { + Segment::flush(); + }); + } } /**