Increase network timeout in Celery tasks

Since Celery tasks don't affect interactive latency, we should have a
more generous timeout. This also allows admins to set the timeout for
Celery and the web frontend separately, without breaking backwards
compatibility with the previous environment variable.
This commit is contained in:
Wesley Aptekar-Cassels 2023-04-06 01:18:35 -04:00
parent e909cbfd4a
commit f91fcd518a
2 changed files with 3 additions and 1 deletions

View file

@ -226,7 +226,7 @@ STREAMS = [
# total time in seconds that the instance will spend searching connectors # total time in seconds that the instance will spend searching connectors
SEARCH_TIMEOUT = env.int("SEARCH_TIMEOUT", 8) SEARCH_TIMEOUT = env.int("SEARCH_TIMEOUT", 8)
# timeout for a query to an individual connector # timeout for a query to an individual connector
QUERY_TIMEOUT = env.int("QUERY_TIMEOUT", 5) QUERY_TIMEOUT = env.int("INTERACTIVE_QUERY_TIMEOUT", env.int("QUERY_TIMEOUT", 5))
# Redis cache backend # Redis cache backend
if env.bool("USE_DUMMY_CACHE", False): if env.bool("USE_DUMMY_CACHE", False):

View file

@ -3,6 +3,8 @@
# pylint: disable=unused-wildcard-import # pylint: disable=unused-wildcard-import
from bookwyrm.settings import * from bookwyrm.settings import *
QUERY_TIMEOUT = env.int("CELERY_QUERY_TIMEOUT", env.int("QUERY_TIMEOUT", 30))
# pylint: disable=line-too-long # pylint: disable=line-too-long
REDIS_BROKER_PASSWORD = requests.utils.quote(env("REDIS_BROKER_PASSWORD", "")) REDIS_BROKER_PASSWORD = requests.utils.quote(env("REDIS_BROKER_PASSWORD", ""))
REDIS_BROKER_HOST = env("REDIS_BROKER_HOST", "redis_broker") REDIS_BROKER_HOST = env("REDIS_BROKER_HOST", "redis_broker")