diff --git a/flask/src/main.py b/flask/src/main.py index 3adec0c2..63df9df6 100644 --- a/flask/src/main.py +++ b/flask/src/main.py @@ -1,6 +1,7 @@ import datetime import operator import os +import random import requests import time from flask import Flask, json, request, make_response, send_from_directory @@ -117,7 +118,7 @@ def products(): try: with sentry_sdk.start_span(op="/products.get_products", description="function"): rows = get_products() - + if RUN_SLOW_PROFILE: start_time = time.time() productsJSON = json.loads(rows) @@ -187,6 +188,10 @@ def api(): @app.route('/organization', methods=['GET']) def organization(): + # perform get_products db query 1% of time in order + # to populate "Found In" endpoints in Queries + if random.random() < 0.01: + rows = get_products() return "flask /organization" @app.route('/connect', methods=['GET'])