<commit_before>from huey.djhuey import crontab, periodic_task, task
from django.conf import settings
from django.contrib.auth import get_user_model
from stats.models import StatisticsEntry


@periodic_task(crontab(minute='*/5'))
def save_user_count():
    count = get_user_model().objects.all().count()
    sdt = StatisticsEntry.objects.create(stat_type='user_count', value=count)<commit_msg>save user_count only once every day<commit_after>from huey.djhuey import crontab, periodic_task, task
from django.conf import settings
from django.contrib.auth import get_user_model
from stats.models import StatisticsEntry


@periodic_task(crontab(hour='0', minute='0'))
def save_user_count():
    count = get_user_model().objects.all().count()
    sdt = StatisticsEntry.objects.create(stat_type='user_count', value=count)
{'fraction_non_alphanumeric': 0.10810810810810811, 'fraction_numerical': 0.0036855036855036856, 'mean_word_length': 6.990196078431373, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3675465', 'n_tokens_mistral': 255, 'n_tokens_neox': 245, 'n_words': 57}