You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
xmrauctions/core/tasks.py

18 lines
533 B
Python

from logging import getLogger
from huey import crontab
from huey.contrib.djhuey import periodic_task
from django.core.cache import cache
from django.conf import settings
from core.monero import AuctionDaemon, AuctionWallet
logger = getLogger('django.server')
@periodic_task(crontab(minute='*'))
def retrieve_daemon_stats():
logger.info('[INFO] Retrieving daemon statistics')
ad = AuctionDaemon()
if ad.connected:
daemon_info = ad.daemon.info()
cache.set('daemon_info', daemon_info, settings.CACHE_TTL)