task management and task runtime flow

This commit is contained in:
meeb
2020-12-07 21:26:46 +11:00
parent f6d00b47eb
commit 647f7162cc
22 changed files with 543 additions and 48 deletions

View File

@@ -1,13 +1,15 @@
import os
from pathlib import Path
from
BASE_DIR = Path(__file__).resolve().parent.parent
ROOT_DIR = Path('/')
SECRET_KEY = str(os.getenv('DJANGO_SECRET_KEY', ''))
ALLOWED_HOSTS_STR = str(os.getenv('DJANGO_ALLOWED_HOSTS', ''))
RANDOM_SECRET = hexlify(os.urandom(32)).decode()
SECRET_KEY = str(os.getenv('DJANGO_SECRET_KEY', RANDOM_SECRET))
ALLOWED_HOSTS_STR = str(os.getenv('TUBESYNC_HOSTS', 'localhost'))
ALLOWED_HOSTS = ALLOWED_HOSTS_STR.split(',')
@@ -19,6 +21,9 @@ DATABASES = {
}
BACKGROUND_TASK_ASYNC_THREADS = int(os.get('TUBESYNC_WORKERS', 2))
MEDIA_ROOT = ROOT_DIR / 'config' / 'media'
SYNC_VIDEO_ROOT = ROOT_DIR / 'downloads' / 'video'
SYNC_AUDIO_ROOT = ROOT_DIR / 'downloads' / 'audio'

View File

@@ -118,10 +118,12 @@ MAX_RUN_TIME = 1800 # Maximum amount of time in seconds
BACKGROUND_TASK_RUN_ASYNC = True # Run tasks async in the background
BACKGROUND_TASK_ASYNC_THREADS = 2 # Number of async tasks to run at once
BACKGROUND_TASK_PRIORITY_ORDERING = 'DESC' # Process high priority tasks first
COMPLETED_TASKS_DAYS_TO_KEEP = 30 # Number of days to keep completed tasks
SOURCES_PER_PAGE = 36
MEDIA_PER_PAGE = 36
TASKS_PER_PAGE = 100
MEDIA_THUMBNAIL_WIDTH = 430 # Width in pixels to resize thumbnails to