stocks/tasks.py
def download_fx_data_task():
    '''
    Creates FX data downloading task chain
    '''
    root_path = os.path.abspath(os.path.dirname(__name__))
    storage_path = root_path + '/static/data'
    img_path_fx = root_path + '/static/img/currency'
    url = 'https://www.alphavantage.co/query?'
    fx_tasks = [
        download_and_draw_fx.signature(
            (
                instrument.base_currency,
                instrument.instrument_currency,
                url,
                storage_path,
                img_path_fx
            ),
            countdown=30,
            immutable=True
        )
        for instrument in CurrencyInstrument.objects.all()
    ]
    logger = download_data_task.get_logger()
    logger.info("Starting FX task chain!")
    chain(fx_tasks).apply_async()

    Creates FX data downloading task chain
    
Creates FX data downloading task chain
Creates FX data downloading task chain
def download_fx_data_task():
    root_path = os.path.abspath(os.path.dirname(__name__))
    storage_path = root_path + '/static/data'
    img_path_fx = root_path + '/static/img/currency'
    url = 'https://www.alphavantage.co/query?'
    fx_tasks = [
        download_and_draw_fx.signature(
            (
                instrument.base_currency,
                instrument.instrument_currency,
                url,
                storage_path,
                img_path_fx
            ),
            countdown=30,
            immutable=True
        )
        for instrument in CurrencyInstrument.objects.all()
    ]
    logger = download_data_task.get_logger()
    logger.info("Starting FX task chain!")
    chain(fx_tasks).apply_async()
def download_fx_data_task ( ) : root_path = os . path . abspath ( os . path . dirname ( __name__ ) ) storage_path = root_path + '/static/data' img_path_fx = root_path + '/static/img/currency' url = 'https://www.alphavantage.co/query?' fx_tasks = [ download_and_draw_fx . signature ( ( instrument . base_currency , instrument . instrument_currency , url , storage_path , img_path_fx ) , countdown = 30 , immutable = True ) for instrument in CurrencyInstrument . objects . all ( ) ] logger = download_data_task . get_logger ( ) logger . info ( "Starting FX task chain!" ) chain ( fx_tasks ) . apply_async ( )
Creates FX data downloading task chain
Creates FX data downloading task chain
'''
    Creates FX data downloading task chain
    '''