mirror of
https://github.com/facebook/sapling.git
synced 2024-12-26 06:21:48 +03:00
sigtrace: ignore errors writing sigtrace files
Summary: Errors could occur with various reasons. Such as permissions. Not having periodical sigtrace does not affect correctness, so let's just ignore errors. Reviewed By: singhsrb Differential Revision: D26192199 fbshipit-source-id: 8d2dba56979efd121c9bdc757895e86aa23d6694
This commit is contained in:
parent
9d8041d04d
commit
a1509b71e4
@ -123,13 +123,16 @@ def reposetup(ui, repo):
|
||||
return
|
||||
|
||||
def writesigtracethread(path, interval):
|
||||
dir = os.path.dirname(path)
|
||||
util.makedirs(dir)
|
||||
while True:
|
||||
time.sleep(interval)
|
||||
# Keep 10 minutes of sigtraces.
|
||||
util.gcdir(dir, 60 * 10)
|
||||
writesigtrace(path)
|
||||
try:
|
||||
dir = os.path.dirname(path)
|
||||
util.makedirs(dir)
|
||||
while True:
|
||||
time.sleep(interval)
|
||||
# Keep 10 minutes of sigtraces.
|
||||
util.gcdir(dir, 60 * 10)
|
||||
writesigtrace(path)
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
path = repo.localvfs.join("sigtrace", "pid-%s-%s" % (os.getpid(), ui.cmdname))
|
||||
thread = threading.Thread(
|
||||
|
Loading…
Reference in New Issue
Block a user