Explorar o código

Adds celery.utils.threads.active_count

Ask Solem %!s(int64=13) %!d(string=hai) anos
pai
achega
144e352ee7
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      celery/utils/threads.py

+ 3 - 0
celery/utils/threads.py

@@ -8,6 +8,9 @@ import traceback
 _Thread = threading.Thread
 _Event = threading._Event
 
+active_count = (getattr(threading, "active_count", None) or
+                threading.activeCount)
+
 
 class Event(_Event):