mirror of
				https://github.com/jlu5/PyLink.git
				synced 2025-11-04 00:47:21 +01:00 
			
		
		
		
	launcher: prevent protocol module init errors from aborting execution
This fixes various issues including: - Networks going missing (the server list is read in a non-deterministic order) - world.started never being set, causing relay to never work!
This commit is contained in:
		
							parent
							
								
									3f7e2328fe
								
							
						
					
					
						commit
						8321485315
					
				
							
								
								
									
										15
									
								
								launcher.py
									
									
									
									
									
								
							
							
						
						
									
										15
									
								
								launcher.py
									
									
									
									
									
								
							@ -139,12 +139,17 @@ def main():
 | 
			
		||||
            log.error("(%s) Configuration error: No protocol module specified, aborting.", network)
 | 
			
		||||
        else:
 | 
			
		||||
            # Fetch the correct protocol module.
 | 
			
		||||
            proto = utils.getProtocolModule(protoname)
 | 
			
		||||
            try:
 | 
			
		||||
                proto = utils.getProtocolModule(protoname)
 | 
			
		||||
 | 
			
		||||
            # Create and connect the network.
 | 
			
		||||
            world.networkobjects[network] = irc = proto.Class(network)
 | 
			
		||||
            log.debug('Connecting to network %r', network)
 | 
			
		||||
            irc.connect()
 | 
			
		||||
                # Create and connect the network.
 | 
			
		||||
                world.networkobjects[network] = irc = proto.Class(network)
 | 
			
		||||
                log.debug('Connecting to network %r', network)
 | 
			
		||||
                irc.connect()
 | 
			
		||||
            except:
 | 
			
		||||
                log.exception('(%s) Failed to connect to network %r, skipping it...',
 | 
			
		||||
                              network, network)
 | 
			
		||||
                continue
 | 
			
		||||
 | 
			
		||||
    world.started.set()
 | 
			
		||||
    log.info("Loaded plugins: %s", ', '.join(sorted(world.plugins.keys())))
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user