<commit_before># -*- coding: utf-8 -*-
#
# Default constance keys, and their values.
#

import datetime

#CONSTANCE_REDIS_CONNECTION is to be found in 'snippets/databases*'
CONSTANCE_BACKEND      = 'constance.backends.redisd.RedisBackend'
CONSTANCE_REDIS_PREFIX = 'c0s1f:'

CONSTANCE_CONFIG = {

    # •••••••••••••••••••••••••••••••••••••••••••••••••••••••••• RSS feed fetch

    # SEMANTIC NOTE: we use 'disabled' (and not 'enabled') because the rss
    # refreshing is something that is enabled in normal conditions. Stopping
    # it is an unusual / rare action, so the setting is named accordingly.
    'FEED_FETCH_DISABLED': (False, ugettext(u'Set this to True for '
                            u'maintenance operations and wait for all '
                            u'fetchers to terminate. It should take at '
                            u'most FEED_FETCH_DEFAULT_INTERVAL seconds.')),

    'FEED_FETCH_GHOST_ENABLED': (False, ugettext(u'Enable Ghost fetching or '
                                 u'not. Disabled by default, make OSX Python '
                                 u'crash.')),

    'FEED_FETCH_DEFAULT_INTERVAL': (3600, ugettext(u'Default feed fetch '
                                    u'interval in seconds. You can tune the '
                                    u'interval for each feed after creation.')),

    'FEED_FETCH_PARALLEL_LIMIT': (100, ugettext(u'Default number of articles '
                                  u'fetchable from the same feed at the same '
                                  u'time. Workers should adjust the value '
                                  u'automatically as time passes.')),

    # •••••••••••••••••••••••••••••••••••••••••••••••• Feed admin configuration

    'FEED_REFRESH_RANDOMIZE': (True, ugettext(u'Set this to False if you want '
                               u'all feeds with the same fetch interval to '
                               u'fetch at the same time. Default is to '
                               u'randomize the refreshs not to hammer our '
                               u'machines.')),

    'FEED_ADMIN_LIST_PER_PAGE': (10, ugettext(u'How many feeds per page in '
                                 u'the Django admin. Increase only if '
                                 u'performance is acceptable; do NOT abuse!')),

    'FEED_ADMIN_MEANINGFUL_DELTA': (6 * 365 / 12, ugettext(u'We see how many '
                                    u'articles feeds have produced during this '
                                    u'delta (in days), to see if we can close '
                                    u'them or not (if they got 0 new '
                                    u'articles).')),

    'FEED_CLOSED_WARN_LIMIT': (5, ugettext(u'Number of days during which a '
                               u'just closed feed will be warned about to '
                               u'site managers.')),
<commit_msg>New constance directives for feed fetch auto-throttling.<commit_after># -*- coding: utf-8 -*-
#
# Default constance keys, and their values.
#

import datetime

#CONSTANCE_REDIS_CONNECTION is to be found in 'snippets/databases*'
CONSTANCE_BACKEND      = 'constance.backends.redisd.RedisBackend'
CONSTANCE_REDIS_PREFIX = 'c0s1f:'

CONSTANCE_CONFIG = {

    # •••••••••••••••••••••••••••••••••••••••••••••••••••••••••• RSS feed fetch

    # SEMANTIC NOTE: we use 'disabled' (and not 'enabled') because the rss
    # refreshing is something that is enabled in normal conditions. Stopping
    # it is an unusual / rare action, so the setting is named accordingly.
    'FEED_FETCH_DISABLED': (False, ugettext(u'Set this to True for '
                            u'maintenance operations and wait for all '
                            u'fetchers to terminate. It should take at '
                            u'most FEED_FETCH_DEFAULT_INTERVAL seconds.')),

    'FEED_FETCH_GHOST_ENABLED': (False, ugettext(u'Enable Ghost fetching or '
                                 u'not. Disabled by default, make OSX Python '
                                 u'crash.')),

    'FEED_FETCH_DEFAULT_INTERVAL': (3600, ugettext(u'Default feed fetch '
                                    u'interval in seconds. You can tune the '
                                    u'interval for each feed after creation.')),

    'FEED_FETCH_MIN_INTERVAL': (300, ugettext(u'The minimum interval between '
                                u'fetches of the same feed. Warning: anything '
                                u'under 60 will not be taken in account.')),

    'FEED_FETCH_MAX_INTERVAL': (86400, ugettext(u'The maximum interval between '
                                u'fetches of the same feed. Warning: anything '
                                u'more than 7 days (expressed in seconds) will '
                                u'not be taken in account.')),

    'FEED_FETCH_RAISE_THRESHOLD': (10, ugettext(u'If this feed produces more '
                                   u'new articles than this number, it will '
                                   u'be fetched more fast than a feed that '
                                   u'produces less. Minimum value: 5.')),

    'FEED_FETCH_PARALLEL_LIMIT': (100, ugettext(u'Default number of articles '
                                  u'fetchable from the same feed at the same '
                                  u'time. Workers should adjust the value '
                                  u'automatically as time passes.')),

    # •••••••••••••••••••••••••••••••••••••••••••••••• Feed admin configuration

    'FEED_REFRESH_RANDOMIZE': (True, ugettext(u'Set this to False if you want '
                               u'all feeds with the same fetch interval to '
                               u'fetch at the same time. Default is to '
                               u'randomize the refreshs not to hammer our '
                               u'machines.')),

    'FEED_ADMIN_LIST_PER_PAGE': (10, ugettext(u'How many feeds per page in '
                                 u'the Django admin. Increase only if '
                                 u'performance is acceptable; do NOT abuse!')),

    'FEED_ADMIN_MEANINGFUL_DELTA': (6 * 365 / 12, ugettext(u'We see how many '
                                    u'articles feeds have produced during this '
                                    u'delta (in days), to see if we can close '
                                    u'them or not (if they got 0 new '
                                    u'articles).')),

    'FEED_CLOSED_WARN_LIMIT': (5, ugettext(u'Number of days during which a '
                               u'just closed feed will be warned about to '
                               u'site managers.')),

{'fraction_non_alphanumeric': 0.10277569392348088, 'fraction_numerical': 0.008102025506376594, 'mean_word_length': 1.5827198760170476, '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': 29, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1544428', 'n_tokens_mistral': 2013, 'n_tokens_neox': 1867, 'n_words': 572}