diff --git a/boofilsic/settings.py b/boofilsic/settings.py index 0fe28d46..ddf122d0 100644 --- a/boofilsic/settings.py +++ b/boofilsic/settings.py @@ -70,6 +70,8 @@ env = environ.FileAwareEnv( NEODB_DOWNLOADER_CACHE_TIMEOUT=(int, 300), # Number of retries of downloader, when site is using RetryDownloader NEODB_DOWNLOADER_RETRIES=(int, 3), + # Number of marks required for an item to be included in discover + NEODB_MIN_MARKS_FOR_DISCOVER=(int, 1), # Disable cron jobs NEODB_DISABLE_CRON=(bool, False), NEODB_DISABLE_CRON_JOBS=(list, []), @@ -180,6 +182,8 @@ INVITE_ONLY = env("NEODB_INVITE_ONLY") # If you are running a development server, set this to True to disable this behavior DISABLE_DEFAULT_RELAY = env("NEODB_DISABLE_DEFAULT_RELAY", default=DEBUG) +MIN_MARKS_FOR_DISCOVER = env("NEODB_MIN_MARKS_FOR_DISCOVER") + MASTODON_ALLOWED_SITES = env("NEODB_LOGIN_MASTODON_WHITELIST") # Allow user to create account with email (and link to Mastodon account later) diff --git a/catalog/jobs/discover.py b/catalog/jobs/discover.py index ddf11d28..9041f6cd 100644 --- a/catalog/jobs/discover.py +++ b/catalog/jobs/discover.py @@ -10,14 +10,14 @@ from common.models import BaseJob, JobManager from journal.models import Comment, ShelfMember, q_item_in_category MAX_ITEMS_PER_PERIOD = 12 -MIN_MARKS = 1 +MIN_MARKS = settings.MIN_MARKS_FOR_DISCOVER MAX_DAYS_FOR_PERIOD = 96 MIN_DAYS_FOR_PERIOD = 6 @JobManager.register class DiscoverGenerator(BaseJob): - interval = timedelta(hours=2) + interval = timedelta(hours=1) def get_popular_marked_item_ids(self, category, days, exisiting_ids): item_ids = [ diff --git a/compose.yml b/compose.yml index 46f5bcdb..3d860aac 100644 --- a/compose.yml +++ b/compose.yml @@ -34,6 +34,7 @@ x-shared: NEODB_DISABLE_DEFAULT_RELAY: NEODB_DISABLE_CRON: NEODB_DISABLE_CRON_JOBS: + NEODB_MIN_MARKS_FOR_DISCOVER: NEODB_SENTRY_DSN: TAKAHE_SENTRY_DSN: NEODB_DB_URL: ${NEODB_DB_URL:-postgres://neodb:aubergine@neodb-db/neodb}