You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I use get_current_tick in a multithreaded setting (see code below), it fails and prints the message "run jqdatasdk.auth first", and returns None.
When I run any other JQData API function with multithreading it runs successfully (no error) and returns a pd.DataFrame.
My guess is this has to do with the way get_current_tick does its authorization check.
Here's a reproducible example:
import jqdatasdk as jq
from concurrent.futures import ThreadPoolExecutor
jq.auth('138********', '********')
##### Multithreaded doesn't work
MAX_THREADS = 3
executor = ThreadPoolExecutor(MAX_THREADS)
stock_data = (result for result in executor.map(jq.get_current_tick, ['000001.XSHE'])) #prints error
next(stock_data) #returns None
########################
#calling it normally works
jq.get_current_tick(['000001.XSHE'])
The text was updated successfully, but these errors were encountered:
When I use
get_current_tick
in a multithreaded setting (see code below), it fails and prints the message "run jqdatasdk.auth first", and returnsNone
.When I run any other JQData API function with multithreading it runs successfully (no error) and returns a
pd.DataFrame
.My guess is this has to do with the way
get_current_tick
does its authorization check.Here's a reproducible example:
The text was updated successfully, but these errors were encountered: