From f3c1b7f42d633540a32dbe888e11b02355952f9f Mon Sep 17 00:00:00 2001 From: Aaron Parecki Date: Tue, 29 Dec 2015 12:45:21 -0800 Subject: [PATCH] add command line task to add a test trip to the queue --- compass/app/Console/Commands/TestTrip.php | 21 +++++++++++++++++++++ compass/app/Console/Kernel.php | 2 +- 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 compass/app/Console/Commands/TestTrip.php diff --git a/compass/app/Console/Commands/TestTrip.php b/compass/app/Console/Commands/TestTrip.php new file mode 100644 index 0000000..55f84d1 --- /dev/null +++ b/compass/app/Console/Commands/TestTrip.php @@ -0,0 +1,21 @@ +where('write_token','=','test')->first(); + $loc = json_decode('{"properties":{"end":"2015-12-28T23:20:14Z","start":"2015-12-28T22:45:22Z","mode":"bicycle","distance":6439.4875686883,"end-coordinates":[-122.67617024493,45.549965919969],"start-coordinates":[-122.63860439893,45.522223161576],"duration":2092.7059409618,"type":"trip","timestamp":"2015-12-28T23:20:14Z"},"stopped_automatically":true,"type":"Feature","geometry":{"type":"Point","coordinates":[-122.67617024493,45.549965919969]}}', true); + $this->dispatch((new TripComplete($db->id, $loc))->onQueue('compass')); + } + +} diff --git a/compass/app/Console/Kernel.php b/compass/app/Console/Kernel.php index ad6e311..876ca5b 100644 --- a/compass/app/Console/Kernel.php +++ b/compass/app/Console/Kernel.php @@ -13,7 +13,7 @@ class Kernel extends ConsoleKernel * @var array */ protected $commands = [ - // + 'App\Console\Commands\TestTrip', ]; /**