This commit is contained in:
pwn
2025-12-14 15:03:09 +03:00
parent 5e647e068d
commit a8ce50d1a4
2 changed files with 7 additions and 3 deletions

View File

@@ -9,6 +9,7 @@ import hashlib
import hmac import hmac
import re import re
import secrets import secrets
import sys
import time import time
from dataclasses import dataclass, field from dataclasses import dataclass, field
from typing import Dict, List, Optional, Tuple from typing import Dict, List, Optional, Tuple
@@ -173,8 +174,11 @@ class SecurityService:
@staticmethod @staticmethod
async def async_input(prompt: str) -> str: async def async_input(prompt: str) -> str:
"""Async input wrapper.""" """Async input wrapper."""
sys.stdout.write(prompt)
sys.stdout.flush()
loop = asyncio.get_event_loop() loop = asyncio.get_event_loop()
return await loop.run_in_executor(None, input, prompt) line = await loop.run_in_executor(None, sys.stdin.readline)
return line.rstrip('\n\r')
@staticmethod @staticmethod
def _validate_length(value: str, maximum: int, field_name: str) -> Optional[str]: def _validate_length(value: str, maximum: int, field_name: str) -> Optional[str]:

View File

@@ -13,8 +13,8 @@ services:
deploy: deploy:
resources: resources:
limits: limits:
cpus: '2' cpus: '4'
memory: 2G memory: 6G
logging: logging:
driver: "json-file" driver: "json-file"
options: options: