re-add windows support

This commit is contained in:
Izalia Mae 2024-02-22 13:28:41 -05:00
parent 001aa87667
commit 61014f791d
3 changed files with 13 additions and 3 deletions

View file

@ -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={},

View file

@ -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

View file

@ -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',