Procházet zdrojové kódy

Adds celery.utils.threads.active_count

Ask Solem před 13 roky
rodič
revize
144e352ee7
1 změnil soubory, kde provedl 3 přidání a 0 odebrání
  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):