mirror of
				https://github.com/librenms/librenms.git
				synced 2024-10-07 16:52:45 +00:00 
			
		
		
		
	use thread name as id
This commit is contained in:
		@@ -236,7 +236,7 @@ devices_scanned = 0
 | 
				
			|||||||
def poll_worker():
 | 
					def poll_worker():
 | 
				
			||||||
    global dev_query
 | 
					    global dev_query
 | 
				
			||||||
    global devices_scanned
 | 
					    global devices_scanned
 | 
				
			||||||
    thread_id = threading.current_thread().ident
 | 
					    thread_id = threading.current_thread().name
 | 
				
			||||||
    db = DB()
 | 
					    db = DB()
 | 
				
			||||||
    while True:
 | 
					    while True:
 | 
				
			||||||
        dev_row = db.query(dev_query)
 | 
					        dev_row = db.query(dev_query)
 | 
				
			||||||
@@ -292,6 +292,7 @@ def poll_worker():
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
for i in range(0, amount_of_workers):
 | 
					for i in range(0, amount_of_workers):
 | 
				
			||||||
    t = threading.Thread(target=poll_worker)
 | 
					    t = threading.Thread(target=poll_worker)
 | 
				
			||||||
 | 
					    t.name = i
 | 
				
			||||||
    t.daemon = True
 | 
					    t.daemon = True
 | 
				
			||||||
    t.start()
 | 
					    t.start()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user