Skip to content

Commit cf610e0

Browse files
authored
Move rate limiting proxy away from shared (#31)
Review #27, #29, #30 first. ## Summary A small detail of the rate limiting proxy had to be adopted for every 3rd party service provider. After discussion with Gasper and Patricija, we're moving this away from shared and into 3rd party service-specific snap-in repos. - [#ISS-217157](https://app.devrev.ai/devrev/works/ISS-217157)
1 parent f3df37f commit cf610e0

File tree

3 files changed

+12
-326
lines changed

3 files changed

+12
-326
lines changed

devrev-snapin-template.plain

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
- The Normalization Function is a function that is responsible for normalizing the data from The API to the data expected by The External Domain Metadata JSON object's record type.
2222

2323
- The Extraction Function is The Function named "extraction". It is responsible for pushing data to the DevRev servers (The DevRev Servers) based on various event types.
24-
- "event_type" equals "EXTRACTION_DATA_START" or "event_type" equals "EXTRACTION_DATA_CONTINUE" and we get a timeout, The Worker Thread should emit event "EXTRACTION_DATA_PROGRESS".
2524

2625
***Non-Functional Requirements:***
2726

rate_limiting_proxy.py

Lines changed: 0 additions & 324 deletions
This file was deleted.

run_devrev_snapin_conformance_tests.sh

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,12 @@ start_mock_devrev_server() {
9191
}
9292

9393
start_proxy_server() {
94-
python3 "$SCRIPT_DIR/rate_limiting_proxy.py" > "$PROXY_SERVER_LOG" 2>&1 &
94+
# Check if the rate limiting proxy file exists
95+
if [ ! -f "$EXEC_DIR/rate_limiting_proxy.py" ]; then
96+
printf "Error: rate_limiting_proxy.py file not found in $EXEC_DIR/rate_limiting_proxy.py. This file should exist (and should be adopted for 3rd party service's rate limiting response format).\n"
97+
exit 69
98+
fi
99+
python3 "$EXEC_DIR/rate_limiting_proxy.py" > "$PROXY_SERVER_LOG" 2>&1 &
95100
PROXY_SERVER_PID=$!
96101
sleep 2 # Give the server time to start
97102

@@ -201,6 +206,12 @@ if [ -z "$EXTRACTED_FILES_FOLDER_PATH" ]; then
201206
exit 69 # EXIT_SERVICE_UNAVAILABLE
202207
fi
203208

209+
# Check if EXTRACTED_FILES_FOLDER_PATH does not end with "node_$1/build"
210+
if [[ "$EXTRACTED_FILES_FOLDER_PATH" != *"node_$1/extracted_files" ]]; then
211+
echo "Error: EXTRACTED_FILES_FOLDER_PATH should end with 'node_$1/extracted_files'."
212+
echo "Note: The value of EXTRACTED_FILES_FOLDER_PATH should be <path_to_directory_where_you_rendered_the_snap-in>/node_$1/extracted_files."
213+
exit 69 # EXIT_SERVICE_UNAVAILABLE
214+
fi
204215

205216
# Check if build folder name is provided
206217
if [ -z "$1" ]; then

0 commit comments

Comments
 (0)