Tasks#

Periodic tasks defined by the coins app. The full schedule, queue routing, and worker invocation flags are in Tasks. Most tasks sleep 10 seconds between items when iterating over the full coin list to respect CoinGecko’s API rate limit.

Price history#

richy.coins.tasks.fetch_historical_data.__wrapped__(coin=None)#

Fetches fresh historical data (prices) for the given coin. Already existing price records gets updated if price differs (solves splits). If no coin was given then fetches data for all coins. Sleeps 10 seconds between each fetch.

If new data has been found we update caches and regenerate performance chart.

Parameters:

coin (int) – Coin PK.

richy.coins.tasks.fetch_current_price.__wrapped__(coin=None)#

Fetches current market price and caches it under “item-{}-current-price” key for ITEM_CURRENT_PRICE_TIMEOUT.. If no coin PK instance is given fetches all coins in database. Sleeps 10 seconds between each fetch.

Parameters:

coin (int) – Coin PK.

Reference data#

richy.coins.tasks.fetch_basic_info.__wrapped__(coin=None)#

Downloads basic info and saves it to ItemData models.

Parameters:

coin (int) – Coin PK.