mirror of
				https://github.com/jlu5/PyLink.git
				synced 2025-11-04 00:47:21 +01:00 
			
		
		
		
	protocols/: thread calls to each event hook to prevent blocking globally
Closes #59.
This commit is contained in:
		
							parent
							
								
									9bef93c341
								
							
						
					
					
						commit
						99fd6060a7
					
				@ -3,6 +3,7 @@ import sys
 | 
			
		||||
import os
 | 
			
		||||
import traceback
 | 
			
		||||
import re
 | 
			
		||||
import threading
 | 
			
		||||
from copy import copy
 | 
			
		||||
 | 
			
		||||
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
 | 
			
		||||
@ -588,7 +589,7 @@ def handle_events(irc, data):
 | 
			
		||||
            for hook_func in utils.command_hooks[hook_cmd]:
 | 
			
		||||
                try:
 | 
			
		||||
                    log.debug('Calling function %s', hook_func)
 | 
			
		||||
                    hook_func(irc, numeric, command, parsed_args)
 | 
			
		||||
                    threading.Thread(target=hook_func, args=(irc, numeric, command, parsed_args)).start()
 | 
			
		||||
                except Exception:
 | 
			
		||||
                    # We don't want plugins to crash our servers...
 | 
			
		||||
                    traceback.print_exc()
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user