Add option to disable order logging

This commit is contained in:
Reckless_Satoshi 2023-09-11 09:24:03 -07:00
parent 847a1905b1
commit 4fe69da565
No known key found for this signature in database
GPG Key ID: 9C4585B561315571
2 changed files with 8 additions and 1 deletions

View File

@ -101,7 +101,12 @@ PENALTY_TIMEOUT = 60
# Time between routing attempts of buyer invoice in MINUTES
RETRY_TIME = 1
# Platform activity limits
# Store Order Logs in DB. Verbose logging for each order as property of the order object in DB. Useful for debugging and for learning
# the order flow for new robosats coordinators (prints a pretty timestamped table on the coordinator panel on each order). But a bit heavy
# on write operations and can potentially affect performance for every request.
DISABLE_ORDER_LOGS = False
# Coordinator activity limits
MAX_PUBLIC_ORDERS = 100
# Trade limits in satoshis

View File

@ -287,6 +287,8 @@ class Order(models.Model):
try/catch block since this function is called inside the main request->response
pipe and any error here would lead to a 500 response.
"""
if config("DISABLE_ORDER_LOGS", cast=bool, default=True):
return
try:
timestamp = timezone.now().replace(microsecond=0).isoformat()
level_in_tag = "" if level == "INFO" else "<b>"