mirror of
https://git.pleroma.social/pleroma/relay.git
synced 2024-11-21 22:17:59 +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')
|
(aiohttp_swagger_path, 'aiohttp_swagger')
|
||||||
],
|
],
|
||||||
hiddenimports=[
|
hiddenimports=[
|
||||||
'gunicorn',
|
'pg8000',
|
||||||
'gunicorn.glogging'
|
'sqlite3'
|
||||||
],
|
],
|
||||||
hookspath=[],
|
hookspath=[],
|
||||||
hooksconfig={},
|
hooksconfig={},
|
||||||
|
|
|
@ -7,6 +7,7 @@ import signal
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
import time
|
import time
|
||||||
|
import traceback
|
||||||
import typing
|
import typing
|
||||||
|
|
||||||
from aiohttp import web
|
from aiohttp import web
|
||||||
|
|
|
@ -2,6 +2,7 @@ from __future__ import annotations
|
||||||
|
|
||||||
import getpass
|
import getpass
|
||||||
import os
|
import os
|
||||||
|
import platform
|
||||||
import typing
|
import typing
|
||||||
import yaml
|
import yaml
|
||||||
|
|
||||||
|
@ -13,11 +14,19 @@ if typing.TYPE_CHECKING:
|
||||||
from typing import Any
|
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] = {
|
DEFAULTS: dict[str, Any] = {
|
||||||
'listen': '0.0.0.0',
|
'listen': '0.0.0.0',
|
||||||
'port': 8080,
|
'port': 8080,
|
||||||
'domain': 'relay.example.com',
|
'domain': 'relay.example.com',
|
||||||
'workers': len(os.sched_getaffinity(0)),
|
'workers': CORE_COUNT,
|
||||||
'db_type': 'sqlite',
|
'db_type': 'sqlite',
|
||||||
'ca_type': 'database',
|
'ca_type': 'database',
|
||||||
'sq_path': 'relay.sqlite3',
|
'sq_path': 'relay.sqlite3',
|
||||||
|
|
Loading…
Reference in a new issue