Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion apps/smartdoc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ def get_db_setting(self) -> dict:
"POOL_SIZE": 20,
"MAX_OVERFLOW": int(self.get('DB_MAX_OVERFLOW')),
"RECYCLE": 1800,
"TIMEOUT": 30
"TIMEOUT": 30,
'PRE_PING': True
}
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The provided code looks mostly correct and does not contain any major issues. However, I would suggest a few minor optimizations and changes:

  1. Consistency in Key Capitalization: Ensure that all dictionary keys use consistent capitalization (or lowercase), such as pool_size, max_overflow, etc.

  2. Comments: Consider adding comments to explain each key-value pair for clarity. This is just a suggestion and doesn't affect the functionality of the function.

Here's the modified version with these suggestions:

@@ -118,7 +118,8 @@ def get_db_setting(self) -> dict:
                 "POOL_SIZE": 20,
                 "MAX_OVERFLOW": int(self.get('DB_MAX_OVERFLOW')),
                 "RECYCLE": 1800,
-                "TIMEOUT": 30
+                "TIMEOUT": 30,
+                'PRE_PING': True
             }
         }

If you need further assistance or have more specific changes in mind, feel free to ask!

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ pylint = "3.3.6"
pydub = "0.25.1"
cffi = "1.17.1"
pysilk = "0.0.1"
django-db-connection-pool = "1.2.5"
django-db-connection-pool = "1.2.6"
opencv-python-headless = "4.11.0.86"
pymysql = "1.1.1"
accelerate = "1.6.0"
Expand Down
Loading