From bf8468a83f5d3272ec4835f99ee78e279d7fa806 Mon Sep 17 00:00:00 2001 From: Daniel Abraham Date: Tue, 20 Aug 2024 20:13:47 +0300 Subject: [PATCH] Quickstart tweaks (#49) --- quickstart/autokitteh.yaml | 6 ------ quickstart/program.py | 4 ++-- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/quickstart/autokitteh.yaml b/quickstart/autokitteh.yaml index 7ce4840..e2de412 100644 --- a/quickstart/autokitteh.yaml +++ b/quickstart/autokitteh.yaml @@ -15,9 +15,3 @@ project: data: path: trigger_path call: program.py:on_http_get - - name: http_get_with_param - connection: http_conn - event_type: get - data: - path: iterations/{iters} - call: program.py:on_http_get diff --git a/quickstart/program.py b/quickstart/program.py index 696a3a7..ed1dc48 100644 --- a/quickstart/program.py +++ b/quickstart/program.py @@ -9,9 +9,9 @@ def on_http_get(event): print(f"Received {event.data.method} request") - iterations = int(event.data.params.get("iters", "0")) + iterations = int(event.data.url.query.get("iterations", "0")) for i in range(iterations): - print("Loop iteration: %d of %d" % (i + 1, iterations)) + print(f"Loop iteration: {i + 1} of {iterations}") time.sleep(FIVE_SECONDS) print(f"Finished processing {event.data.method} request")