mirror of
https://github.com/wahyd4/links.git
synced 2026-08-08 21:04:53 +10:00
22 lines
698 B
Python
22 lines
698 B
Python
import logging
|
|
|
|
from django.apps import AppConfig
|
|
|
|
logger = logging.getLogger(__name__)
|
|
|
|
|
|
class PricemonConfig(AppConfig):
|
|
default_auto_field = 'django.db.models.BigAutoField'
|
|
name = 'pricemon'
|
|
|
|
def ready(self):
|
|
import pricemon.signals # noqa: F401
|
|
try:
|
|
from pricemon.tasks import schedule_watcher
|
|
from pricemon.models import PriceWatcher
|
|
for watcher in PriceWatcher.objects.filter(enabled=True):
|
|
schedule_watcher(watcher)
|
|
logger.info(f'Scheduled pricemon watcher: {watcher.name}')
|
|
except Exception as exc:
|
|
logger.warning(f'Could not schedule pricemon watchers on startup: {exc}')
|