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(); + }); + } } /**