APM faulthandler from cfg file
Register faulthandler in case apm options is True because some other process get AttributeError fileno (celery)
This commit is contained in:
parent
b79b8ca2b6
commit
4c059c9007
10
top.diff
10
top.diff
|
@ -39,13 +39,16 @@ diff -r 649b0805fa93 trytond/protocols/dispatcher.py
|
||||||
diff -r 649b0805fa93 trytond/protocols/top.py
|
diff -r 649b0805fa93 trytond/protocols/top.py
|
||||||
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
|
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
|
||||||
+++ b/trytond/trytond/protocols/top.py Sun Apr 19 03:18:20 2015 +0200
|
+++ b/trytond/trytond/protocols/top.py Sun Apr 19 03:18:20 2015 +0200
|
||||||
@@ -0,0 +1,90 @@
|
@@ -0,0 +1,94 @@
|
||||||
+import random
|
+import random
|
||||||
+import signal
|
+import signal
|
||||||
+import locale
|
+import locale
|
||||||
+import faulthandler
|
+import faulthandler
|
||||||
+from operator import itemgetter
|
+from operator import itemgetter
|
||||||
+from datetime import datetime
|
+from datetime import datetime
|
||||||
|
+from trytond.config import config as config_
|
||||||
|
+
|
||||||
|
+APM = config_.getboolean('optional', 'apm', default=True)
|
||||||
+
|
+
|
||||||
+current_actions = {}
|
+current_actions = {}
|
||||||
+action_id = 0
|
+action_id = 0
|
||||||
|
@ -113,8 +116,9 @@ diff -r 649b0805fa93 trytond/protocols/top.py
|
||||||
+ pprint_table(table)
|
+ pprint_table(table)
|
||||||
+ print '=' * 30
|
+ print '=' * 30
|
||||||
+
|
+
|
||||||
+signal.signal(signal.SIGUSR1, signal_user_handler)
|
+if APM:
|
||||||
+faulthandler.register(signal.SIGUSR2)
|
+ signal.signal(signal.SIGUSR1, signal_user_handler)
|
||||||
|
+ faulthandler.register(signal.SIGUSR2)
|
||||||
+
|
+
|
||||||
+
|
+
|
||||||
+def add(value):
|
+def add(value):
|
||||||
|
|
Loading…
Reference in New Issue