discover cron run hourly
This commit is contained in:
parent
ab4bceb1c3
commit
e6ec9b1f9d
3 changed files with 7 additions and 2 deletions
|
@ -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)
|
||||
|
|
|
@ -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 = [
|
||||
|
|
|
@ -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}
|
||||
|
|
Loading…
Add table
Reference in a new issue