mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-04-27 03:00:12 -04:00
tdb_sql: Up the number of frames in traceback.
tdb_sql has a lot of functions. Seven frames was frequently insufficient to see who was phone.
This commit is contained in:
@@ -369,7 +369,7 @@ def add_request_info(select):
|
||||
def sanitize(txt):
|
||||
return _spaces.sub(' ', txt).replace("/", "|").replace("-", "_").replace(';', "").replace("*", "").replace(r"/", "")
|
||||
|
||||
tb = simple_traceback()
|
||||
tb = simple_traceback(limit=12)
|
||||
try:
|
||||
if (hasattr(request, 'path') and
|
||||
hasattr(request, 'ip') and
|
||||
|
||||
@@ -65,7 +65,7 @@ class MemcacheLock(object):
|
||||
def acquire(self):
|
||||
start = datetime.now()
|
||||
|
||||
my_info = (reddit_host, reddit_pid, simple_traceback())
|
||||
my_info = (reddit_host, reddit_pid, simple_traceback(limit=7))
|
||||
|
||||
#if this thread already has this lock, move on
|
||||
if self.key in self.locks:
|
||||
|
||||
@@ -1401,10 +1401,14 @@ def parse_http_basic(authorization_header):
|
||||
return require_split(auth_data, 2, ":")
|
||||
|
||||
|
||||
def simple_traceback():
|
||||
"""Generate a pared-down traceback that's human readable but small."""
|
||||
def simple_traceback(limit):
|
||||
"""Generate a pared-down traceback that's human readable but small.
|
||||
|
||||
stack_trace = traceback.extract_stack(limit=7)[:-2]
|
||||
`limit` is how many frames of the stack to put in the traceback.
|
||||
|
||||
"""
|
||||
|
||||
stack_trace = traceback.extract_stack(limit=limit)[:-2]
|
||||
return "\n".join(":".join((os.path.basename(filename),
|
||||
function_name,
|
||||
str(line_number),
|
||||
|
||||
Reference in New Issue
Block a user