discover cron run hourly

This commit is contained in:
Your Name 2024-01-14 13:12:43 -05:00 committed by Henri Dickson
parent ab4bceb1c3
commit e6ec9b1f9d
3 changed files with 7 additions and 2 deletions

View file

@ -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)

View file

@ -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 = [

View file

@ -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}