Skip to content

Commit 7863bb4

Browse files
committed
Set timeout to 10ms
1 parent a5645a9 commit 7863bb4

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

aikido_zen/sources/functions/request_handler.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ def pre_response():
5050
return message, 403
5151

5252
# Do a check on firewall lists, this happens in background because of the heavy data.
53+
# For the timeout we notice the request during heavy loads usually takes 2ms - 2.5ms, we set timeout at 10ms.
54+
# That way we have a very small timeout with very little risk of not blocking ips.
5355
comms = c.get_comms()
5456
check_fw_lists_res = comms.send_data_to_bg_process(
5557
action="CHECK_FIREWALL_LISTS",
@@ -58,7 +60,7 @@ def pre_response():
5860
"user-agent": context.get_user_agent(),
5961
},
6062
receive=True,
61-
timeout_in_sec=(20 / 1000),
63+
timeout_in_sec=(10 / 1000),
6264
)
6365
if not check_fw_lists_res["success"] or not check_fw_lists_res["data"]["blocked"]:
6466
return

0 commit comments

Comments
 (0)