add options to disable cron jobs
This commit is contained in:
parent
382558b50d
commit
82e7bd5824
3 changed files with 10 additions and 2 deletions
|
@ -66,6 +66,8 @@ env = environ.FileAwareEnv(
|
||||||
NEODB_DOWNLOADER_CACHE_TIMEOUT=(int, 300),
|
NEODB_DOWNLOADER_CACHE_TIMEOUT=(int, 300),
|
||||||
# Number of retries of downloader, when site is using RetryDownloader
|
# Number of retries of downloader, when site is using RetryDownloader
|
||||||
NEODB_DOWNLOADER_RETRIES=(int, 3),
|
NEODB_DOWNLOADER_RETRIES=(int, 3),
|
||||||
|
# Disable cron jobs
|
||||||
|
NEODB_DISABLE_CRON=(bool, False),
|
||||||
# INTEGRATED TAKAHE CONFIGURATION
|
# INTEGRATED TAKAHE CONFIGURATION
|
||||||
TAKAHE_DB_URL=(str, "postgres://takahe:takahepass@127.0.0.1:5432/takahe"),
|
TAKAHE_DB_URL=(str, "postgres://takahe:takahepass@127.0.0.1:5432/takahe"),
|
||||||
# Spotify - https://developer.spotify.com/
|
# Spotify - https://developer.spotify.com/
|
||||||
|
@ -220,6 +222,8 @@ DOWNLOADER_REQUEST_TIMEOUT = env("NEODB_DOWNLOADER_REQUEST_TIMEOUT")
|
||||||
DOWNLOADER_CACHE_TIMEOUT = env("NEODB_DOWNLOADER_CACHE_TIMEOUT")
|
DOWNLOADER_CACHE_TIMEOUT = env("NEODB_DOWNLOADER_CACHE_TIMEOUT")
|
||||||
DOWNLOADER_RETRIES = env("NEODB_DOWNLOADER_RETRIES")
|
DOWNLOADER_RETRIES = env("NEODB_DOWNLOADER_RETRIES")
|
||||||
|
|
||||||
|
DISABLE_CRON = env("NEODB_DISABLE_CRON")
|
||||||
|
|
||||||
# ====== USER CONFIGUTRATION END ======
|
# ====== USER CONFIGUTRATION END ======
|
||||||
|
|
||||||
DATABASE_ROUTERS = ["takahe.db_routes.TakaheRouter"]
|
DATABASE_ROUTERS = ["takahe.db_routes.TakaheRouter"]
|
||||||
|
@ -502,7 +506,7 @@ DEVELOPER_CONSOLE_APPLICATION_CLIENT_ID = "NEODB_DEVELOPER_CONSOLE"
|
||||||
# CORS_ALLOWED_ORIGINS = []
|
# CORS_ALLOWED_ORIGINS = []
|
||||||
# CORS_ALLOWED_ORIGIN_REGEXES = []
|
# CORS_ALLOWED_ORIGIN_REGEXES = []
|
||||||
CORS_ALLOW_ALL_ORIGINS = True
|
CORS_ALLOW_ALL_ORIGINS = True
|
||||||
CORS_URLS_REGEX = r"^/api/.*$"
|
CORS_URLS_REGEX = r"^/(api|nodeinfo)/.*$"
|
||||||
CORS_ALLOW_METHODS = (
|
CORS_ALLOW_METHODS = (
|
||||||
"DELETE",
|
"DELETE",
|
||||||
"GET",
|
"GET",
|
||||||
|
|
|
@ -152,6 +152,9 @@ class Setup:
|
||||||
Indexer.init()
|
Indexer.init()
|
||||||
|
|
||||||
# Register cron jobs if not yet
|
# Register cron jobs if not yet
|
||||||
JobManager.schedule_all()
|
if settings.DISABLE_CRON:
|
||||||
|
logger.info("Cron jobs are disabled.")
|
||||||
|
else:
|
||||||
|
JobManager.schedule_all()
|
||||||
|
|
||||||
logger.info("Finished post-migration setup.")
|
logger.info("Finished post-migration setup.")
|
||||||
|
|
|
@ -30,6 +30,7 @@ x-shared:
|
||||||
NEODB_LOGIN_MASTODON_WHITELIST:
|
NEODB_LOGIN_MASTODON_WHITELIST:
|
||||||
NEODB_MASTODON_CLIENT_SCOPE:
|
NEODB_MASTODON_CLIENT_SCOPE:
|
||||||
NEODB_DISABLE_DEFAULT_RELAY:
|
NEODB_DISABLE_DEFAULT_RELAY:
|
||||||
|
NEODB_DISABLE_CRON:
|
||||||
NEODB_SENTRY_DSN:
|
NEODB_SENTRY_DSN:
|
||||||
TAKAHE_SENTRY_DSN:
|
TAKAHE_SENTRY_DSN:
|
||||||
NEODB_DB_URL: postgres://neodb:aubergine@neodb-db/neodb
|
NEODB_DB_URL: postgres://neodb:aubergine@neodb-db/neodb
|
||||||
|
|
Loading…
Add table
Reference in a new issue