77# config path
88CONFIG_PATH = os .path .join ("config.json" )
99
10+
1011class 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+
1820class RedisConfigModel (BaseModel ):
1921 host : str = "localhost"
2022 port : int = 6379
2123 password : Optional [str ] = None
2224 database : int = 0
2325
26+
2427class 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
3438class 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-
6265class Config :
6366 @staticmethod
6467 def save (model : ConfigModel = ConfigModel (), target = CONFIG_PATH ):
0 commit comments