def PostFetch(positions): """Launch tasks that should be executed after fetching new data.""" rows_dict = utils.RowsAsDicts(positions) # Tasks that operate on all rows. rows_json = json.dumps(rows_dict) celery_app.send_task('app.tasks.basic_geo.StoreDistanceTraversed', [rows_json]) # Tasks that only operate on a single row at a time. for row_dict in rows_dict: args = [json.dumps(row_dict)] celery_app.send_task('app.tasks.maps.StoreMapsInformation', args) celery_app.send_task('app.tasks.weather.StoreWeatherInformation', args)
def NewWordpress(): """Update local records of wordpress articles.""" post_id = str(request.values.get('id')) celery_app.send_task('app.tasks.wordpress.UpdatePost', [post_id]) return 'added to the processing queue'