From 15d840c2604e01231f11419ae6c13c2be9085141 Mon Sep 17 00:00:00 2001
From: David Barnes <barnesdavidj@gmail.com>
Date: Mon, 24 Oct 2022 19:40:48 -0400
Subject: [PATCH] Update max recursive depth constant to be 5 instead of 20.
 Update documentation to match new default.

---
 django_dump_die/constants.py  | 11 +++++++----
 docs/source/configuration.rst |  4 ++--
 2 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/django_dump_die/constants.py b/django_dump_die/constants.py
index 1ad6646..a20d34b 100644
--- a/django_dump_die/constants.py
+++ b/django_dump_die/constants.py
@@ -63,10 +63,13 @@ ADDITIONAL_SIMPLE_TYPES = getattr(settings, 'DJANGO_DD_ADDITIONAL_SIMPLE_TYPES',
 # List of additional intermediate types defined as strings that do not need to be recursively inspected.
 ADDITIONAL_INTERMEDIATE_TYPES = getattr(settings, 'DJANGO_DD_ADDITIONAL_INTERMEDIATE_TYPES', [])
 # Max recursion depth to go while processing the dumped variable.
-MAX_RECURSION_DEPTH = getattr(settings, 'DJANGO_DD_MAX_RECURSION_DEPTH', 20)
-# Max number of iterables to recursively process before just printing the unique
-# instead of recursing further. EX: if set to 20, a list of 30 will recursively
-# inspect and print out 20 items and then simply print the unique for the last 10.
+# Deep recursion will cause DD to take forever on complex structures.
+MAX_RECURSION_DEPTH = getattr(settings, 'DJANGO_DD_MAX_RECURSION_DEPTH', 5)
+# Max number of entries in an iterable to process further with recursion.
+# After reaching an entry beyond this length, it will just print the unique
+# instead of recursing into the entry to find further details.
+# EX: if set to 20, a list of 30 will recursively inspect and print out 20
+# items and then simply print the unique for the last 10.
 MAX_ITERABLE_LENGTH = getattr(settings, 'DJANGO_DD_MAX_ITERABLE_LENGTH', 20)
 # Whether each dump should include the filename and linenumber of the dump call.
 INCLUDE_FILENAME_LINENUMBER = getattr(settings, 'DJANGO_DD_INCLUDE_FILENAME_LINENUMBER', False)
diff --git a/docs/source/configuration.rst b/docs/source/configuration.rst
index 6c7de5a..67bd03b 100644
--- a/docs/source/configuration.rst
+++ b/docs/source/configuration.rst
@@ -18,11 +18,11 @@ as to prevent long processing times.
     Setting the value to ```None``` will mean no limit.
 
 :Type: ``int``
-:Default: ``20``
+:Default: ``5``
 
 Example::
 
-    DJANGO_DD_MAX_RECURSION_DEPTH = 30
+    DJANGO_DD_MAX_RECURSION_DEPTH = 10
 
 
 
-- 
GitLab