Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Temopararily allow to configure webhook cache timeouts

Cezary Miączf92f615a059c
diff --git a/saleor/webhook/const.py b/saleor/webhook/const.py
index 429f02b038..d4ba8bff9d 100644
--- a/saleor/webhook/const.py
+++ b/saleor/webhook/const.py
@@ -1,3 +1,6 @@
-CACHE_EXCLUDED_SHIPPING_TIME = 60 * 3
-WEBHOOK_CACHE_DEFAULT_TIMEOUT: int = 5 * 60 # 5 minutes
+import os
+
+# TODO: restore hardcoded values or move to settings
+CACHE_EXCLUDED_SHIPPING_TIME = int(os.environ.get("WEBHOOK_CACHE_EXCLUDED_SHIPPING_TIME", 3 * 60))
+WEBHOOK_CACHE_DEFAULT_TIMEOUT = int(os.environ.get("WEBHOOK_CACHE_DEFAULT_TIMEOUT", 5 * 60))
APP_ID_PREFIX = "app"