ciyidogan commited on
Commit
7c08baa
·
verified ·
1 Parent(s): 91a9883

Update config_provider.py

Browse files
Files changed (1) hide show
  1. config_provider.py +14 -4
config_provider.py CHANGED
@@ -64,6 +64,11 @@ class ConfigProvider:
64
  with open(cls._CONFIG_PATH, 'r', encoding='utf-8') as f:
65
  config_data = commentjson.load(f)
66
 
 
 
 
 
 
67
  # Ensure required fields
68
  if 'config' not in config_data:
69
  config_data['config'] = {}
@@ -75,6 +80,11 @@ class ConfigProvider:
75
  # Validate and create model
76
  cfg = ServiceConfig.model_validate(config_data)
77
 
 
 
 
 
 
78
  log_debug(
79
  "Configuration loaded",
80
  projects=len(cfg.projects),
@@ -83,10 +93,10 @@ class ConfigProvider:
83
  )
84
 
85
  return cfg
86
-
87
- except Exception as e:
88
- log_error(f"Error loading config", error=str(e), path=str(cls._CONFIG_PATH))
89
- raise ConfigurationError(f"Failed to load configuration: {e}")
90
 
91
  @classmethod
92
  def _parse_api_configs(cls, apis: List[Dict[str, Any]]) -> None:
 
64
  with open(cls._CONFIG_PATH, 'r', encoding='utf-8') as f:
65
  config_data = commentjson.load(f)
66
 
67
+ # Debug: İlk project'in tarihini kontrol et
68
+ if 'projects' in config_data and len(config_data['projects']) > 0:
69
+ first_project = config_data['projects'][0]
70
+ log_debug(f"🔍 Raw project data - last_update_date: {first_project.get('last_update_date')}")
71
+
72
  # Ensure required fields
73
  if 'config' not in config_data:
74
  config_data['config'] = {}
 
80
  # Validate and create model
81
  cfg = ServiceConfig.model_validate(config_data)
82
 
83
+ # Debug: Model'e dönüştükten sonra kontrol et
84
+ if cfg.projects and len(cfg.projects) > 0:
85
+ log_debug(f"🔍 Parsed project - last_update_date: {cfg.projects[0].last_update_date}")
86
+ log_debug(f"🔍 Type: {type(cfg.projects[0].last_update_date)}")
87
+
88
  log_debug(
89
  "Configuration loaded",
90
  projects=len(cfg.projects),
 
93
  )
94
 
95
  return cfg
96
+
97
+ except Exception as e:
98
+ log_error(f"Error loading config", error=str(e), path=str(cls._CONFIG_PATH))
99
+ raise ConfigurationError(f"Failed to load configuration: {e}")
100
 
101
  @classmethod
102
  def _parse_api_configs(cls, apis: List[Dict[str, Any]]) -> None: