`ib`: stick exc handler around client connection erros
							parent
							
								
									49958e68ea
								
							
						
					
					
						commit
						d9344aa468
					
				| 
						 | 
					@ -736,9 +736,19 @@ async def stream_quotes(
 | 
				
			||||||
    sym = symbols[0]
 | 
					    sym = symbols[0]
 | 
				
			||||||
    log.info(f'request for real-time quotes: {sym}')
 | 
					    log.info(f'request for real-time quotes: {sym}')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    proxy: MethodProxy
 | 
				
			||||||
    async with open_data_client() as proxy:
 | 
					    async with open_data_client() as proxy:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        con, first_ticker, details = await proxy.get_sym_details(symbol=sym)
 | 
					        try:
 | 
				
			||||||
 | 
					            (
 | 
				
			||||||
 | 
					                con,
 | 
				
			||||||
 | 
					                first_ticker,
 | 
				
			||||||
 | 
					                details,
 | 
				
			||||||
 | 
					            ) = await proxy.get_sym_details(symbol=sym)
 | 
				
			||||||
 | 
					        except ConnectionError:
 | 
				
			||||||
 | 
					            log.exception(f'Proxy is ded {proxy._aio_ns}')
 | 
				
			||||||
 | 
					            raise
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        first_quote = normalize(first_ticker)
 | 
					        first_quote = normalize(first_ticker)
 | 
				
			||||||
        # print(f'first quote: {first_quote}')
 | 
					        # print(f'first quote: {first_quote}')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -825,7 +835,7 @@ async def stream_quotes(
 | 
				
			||||||
            await trio.sleep_forever()
 | 
					            await trio.sleep_forever()
 | 
				
			||||||
            return  # we never expect feed to come up?
 | 
					            return  # we never expect feed to come up?
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        cs: Optional[trio.CancelScope] = None
 | 
					        cs: trio.CancelScope | None = None
 | 
				
			||||||
        startup: bool = True
 | 
					        startup: bool = True
 | 
				
			||||||
        while (
 | 
					        while (
 | 
				
			||||||
            startup
 | 
					            startup
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue