Skip to content

Commit 37506bf

Browse files
committed
style: 格式化配置文件中的注释和空行
1 parent b78a8b5 commit 37506bf

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

mcim_sync/config.py

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
# config path
88
CONFIG_PATH = os.path.join("config.json")
99

10+
1011
class MongodbConfigModel(BaseModel):
1112
host: str = "localhost"
1213
port: int = 27017
@@ -15,21 +16,24 @@ class MongodbConfigModel(BaseModel):
1516
password: Optional[str] = None
1617
database: str = "database"
1718

19+
1820
class RedisConfigModel(BaseModel):
1921
host: str = "localhost"
2022
port: int = 6379
2123
password: Optional[str] = None
2224
database: int = 0
2325

26+
2427
class JobInterval(BaseModel):
25-
curseforge_refresh: int = 60 * 60 * 2 # 2 hours
26-
modrinth_refresh: int = 60 * 60 * 2 # 2 hours
27-
sync_curseforge: int = 60 * 5 # 5 minutes
28-
sync_modrinth: int = 60 * 5 # 5 minutes
29-
curseforge_categories: int = 60 * 60 * 24 # 24 hours
30-
modrinth_tags: int = 60 * 60 * 24 # 24 hours
31-
global_statistics: int = 60 * 60 * 24 # 24 hours
32-
sync_modrinth_by_search: int = 60 * 60 * 2 # 24 hours
28+
curseforge_refresh: int = 60 * 60 * 2 # 2 hours
29+
modrinth_refresh: int = 60 * 60 * 2 # 2 hours
30+
sync_curseforge: int = 60 * 5 # 5 minutes
31+
sync_modrinth: int = 60 * 5 # 5 minutes
32+
sync_modrinth_by_search: int = 60 * 60 * 2 # 2 hours
33+
curseforge_categories: int = 60 * 60 * 24 # 24 hours
34+
modrinth_tags: int = 60 * 60 * 24 # 24 hours
35+
global_statistics: int = 60 * 60 * 24 # 24 hours
36+
3337

3438
class ConfigModel(BaseModel):
3539
debug: bool = False
@@ -53,12 +57,11 @@ class ConfigModel(BaseModel):
5357
telegram_proxy: Optional[str] = None
5458
proxies: Optional[str] = None
5559
file_cdn: bool = False
56-
max_file_size: int = 1024 * 1024 * 20 # 20MB
60+
max_file_size: int = 1024 * 1024 * 20 # 20MB
5761
log_to_file: bool = False
5862
log_path: str = "./logs"
5963

6064

61-
6265
class Config:
6366
@staticmethod
6467
def save(model: ConfigModel = ConfigModel(), target=CONFIG_PATH):

0 commit comments

Comments
 (0)