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')
],
hiddenimports=[
'gunicorn',
'gunicorn.glogging'
'pg8000',
'sqlite3'
],
hookspath=[],
hooksconfig={},

View file

@ -7,6 +7,7 @@ import signal
import subprocess
import sys
import time
import traceback
import typing
from aiohttp import web

View file

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