Skip to content

Commit

Permalink
Default workers to the number of cores
Browse files Browse the repository at this point in the history
  • Loading branch information
derneuere committed Jul 8, 2024
1 parent f2330cf commit 551c88f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions librephotos/settings/production.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@

SIMPLE_JWT = {
"ACCESS_TOKEN_LIFETIME": datetime.timedelta(minutes=5),
"REFRESH_TOKEN_LIFETIME": datetime.timedelta(days=int(os.environ.get("REFRESH_TOKEN_DAYS", "7"))),
"REFRESH_TOKEN_LIFETIME": datetime.timedelta(
days=int(os.environ.get("REFRESH_TOKEN_DAYS", "7"))
),
}

INSTALLED_APPS = [
Expand All @@ -71,10 +73,10 @@
"django_q",
]

# Must be less or equal of nb core CPU ( Nearly 2GB per process)
HEAVYWEIGHT_PROCESS_ENV = os.environ.get("HEAVYWEIGHT_PROCESS", "1")
# Defaults to number of cores of the host system
HEAVYWEIGHT_PROCESS_ENV = os.environ.get("HEAVYWEIGHT_PROCESS", None)
HEAVYWEIGHT_PROCESS = (
int(HEAVYWEIGHT_PROCESS_ENV) if HEAVYWEIGHT_PROCESS_ENV.isnumeric() else 1
int(HEAVYWEIGHT_PROCESS_ENV) if HEAVYWEIGHT_PROCESS_ENV.isnumeric() else None
)

Q_CLUSTER = {
Expand Down

0 comments on commit 551c88f

Please sign in to comment.