Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (!isNaN(trip_length_delta)){
- service.search_range_flexible_trip_length_and_wait_until_is_ready(start_date, origin, destination, trip_length, delta_start, delta_return, sort_by, trip_length_delta, function(result){
- //Test our Data prior to running update function.
- console.log(chalk.red.bold("Trip_Length"));
- console.log(chalk.red.bold("Trip_Length: " + result.trip_length));
- console.log(chalk.red.bold("Stop_Count: " + result.legs.stop_count));
- console.log(chalk.red.bold("Duration: " + result.legs.duration));
- rethinkdb.update_flights(origin, destination, result.start_date, result.return_date, result.price.amount, result.trip_length, result.legs {stop_count}, result.legs.duration, { price: result.price, legs: result.legs}); // Added result.trip_length, result.stop_count, result.duration
- rethinkdb.update_cache(origin, destination, result.start_date, result.return_date, result.price.amount, { price: result.price, legs: result.legs});
- }).then(function(result){
- if (req.query.merge != null){
- var result = _.flatten(result);
- result = utils.sortResultBy(result, 'price');
- var q = result.length;
- }else{
- var q = _.reduce(result, function(memo, l){ return memo + l.length; }, 0)
- }
- console.log(chalk.red.bold("Last executed queries: " + q));
- res.send(result);
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement