MCPcopy Create free account
hub / github.com/FSoft-AI4Code/CodeWiki / WebAppConfig

Class WebAppConfig

codewiki/src/fe/config.py:10–51  ·  view source on GitHub ↗

Configuration class for web application settings.

Source from the content-addressed store, hash-verified

8
9
10class WebAppConfig:
11 """Configuration class for web application settings."""
12
13 # Directories
14 CACHE_DIR = "./output/cache"
15 TEMP_DIR = "./output/temp"
16 OUTPUT_DIR = "./output"
17
18 # Queue settings
19 QUEUE_SIZE = 100
20
21 # Cache settings
22 CACHE_EXPIRY_DAYS = 365
23
24 # Job cleanup settings
25 JOB_CLEANUP_HOURS = 24000
26 RETRY_COOLDOWN_MINUTES = 3
27
28 # Server settings
29 DEFAULT_HOST = "127.0.0.1"
30 DEFAULT_PORT = 8000
31
32 # Git settings
33 CLONE_TIMEOUT = 300
34 CLONE_DEPTH = 1
35
36 @classmethod
37 def ensure_directories(cls):
38 """Ensure all required directories exist."""
39 directories = [
40 cls.CACHE_DIR,
41 cls.TEMP_DIR,
42 cls.OUTPUT_DIR
43 ]
44
45 for directory in directories:
46 Path(directory).mkdir(parents=True, exist_ok=True)
47
48 @classmethod
49 def get_absolute_path(cls, path: str) -> str:
50 """Get absolute path for a given relative path."""
51 return os.path.abspath(path)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected