mirror of
https://git.pleroma.social/pleroma/relay.git
synced 2024-11-24 15:31:08 +00:00
re-add windows support
This commit is contained in:
parent
001aa87667
commit
61014f791d
|
@ -16,8 +16,8 @@ a = Analysis(
|
|||
(aiohttp_swagger_path, 'aiohttp_swagger')
|
||||
],
|
||||
hiddenimports=[
|
||||
'gunicorn',
|
||||
'gunicorn.glogging'
|
||||
'pg8000',
|
||||
'sqlite3'
|
||||
],
|
||||
hookspath=[],
|
||||
hooksconfig={},
|
||||
|
|
|
@ -7,6 +7,7 @@ import signal
|
|||
import subprocess
|
||||
import sys
|
||||
import time
|
||||
import traceback
|
||||
import typing
|
||||
|
||||
from aiohttp import web
|
||||
|
|
|
@ -2,6 +2,7 @@ from __future__ import annotations
|
|||
|
||||
import getpass
|
||||
import os
|
||||
import platform
|
||||
import typing
|
||||
import yaml
|
||||
|
||||
|
@ -13,11 +14,19 @@ if typing.TYPE_CHECKING:
|
|||
from typing import Any
|
||||
|
||||
|
||||
if platform.system() == 'Windows':
|
||||
import multiprocessing
|
||||
CORE_COUNT = multiprocessing.cpu_count()
|
||||
|
||||
else:
|
||||
CORE_COUNT = len(os.sched_getaffinity(0))
|
||||
|
||||
|
||||
DEFAULTS: dict[str, Any] = {
|
||||
'listen': '0.0.0.0',
|
||||
'port': 8080,
|
||||
'domain': 'relay.example.com',
|
||||
'workers': len(os.sched_getaffinity(0)),
|
||||
'workers': CORE_COUNT,
|
||||
'db_type': 'sqlite',
|
||||
'ca_type': 'database',
|
||||
'sq_path': 'relay.sqlite3',
|
||||
|
|
Loading…
Reference in a new issue