limit the number of videos to process

This commit is contained in:
Laurent DEFERT 2022-12-28 12:37:32 +01:00
parent 7d16a1714c
commit 2f475bf2a8
2 changed files with 6 additions and 2 deletions

View File

@ -477,7 +477,11 @@ class Source(models.Model):
response = indexer(self.index_url)
if not isinstance(response, dict):
return []
return response.get('entries', [])
entries = response.get('entries', [])
if settings.MAX_ENTRIES_PROCESSING:
entries = entries[:settings.MAX_ENTRIES_PROCESSING]
return entries
def get_media_thumb_path(instance, filename):

View File

@ -138,7 +138,7 @@ BACKGROUND_TASK_ASYNC_THREADS = 1 # Number of async tasks to run at on
MAX_BACKGROUND_TASK_ASYNC_THREADS = 8 # For sanity reasons
BACKGROUND_TASK_PRIORITY_ORDERING = 'ASC' # Use 'niceness' task priority ordering
COMPLETED_TASKS_DAYS_TO_KEEP = 7 # Number of days to keep completed tasks
MAX_ENTRIES_PROCESSING = 0 # Number of videos to process on source refresh (0 for no limit)
SOURCES_PER_PAGE = 100
MEDIA_PER_PAGE = 144