From 6fd5ad2bf1cf90948cbfd5613fbcd5dda94d8793 Mon Sep 17 00:00:00 2001 From: Aaron Parecki Date: Sun, 21 May 2017 11:09:31 +0200 Subject: [PATCH] skip importing trips that are too short --- compass/app/Jobs/TripComplete.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/compass/app/Jobs/TripComplete.php b/compass/app/Jobs/TripComplete.php index f2a9d99..874a800 100644 --- a/compass/app/Jobs/TripComplete.php +++ b/compass/app/Jobs/TripComplete.php @@ -126,6 +126,11 @@ class TripComplete extends Job implements SelfHandling, ShouldQueue $endDate->setTimeZone(new DateTimeZone($end->timezone)); } + if($endDate->format('U') - $startDate->format('U') < 15) { + Log::info("Skipping trip since it was too short"); + return; + } + $params = [ 'h' => 'entry', 'published' => $endDate->format('c'),