feat: 实现配置热重载功能
- 引入热加载机制:集成 `notify-debouncer-mini` 监听 `./mocks` 目录,实现 YAML 变动自动重载。 - 优化并发控制:将 `MockRouter` 包装在 `RwLock` 中,确保 Web 线程(读)与监控线程(写)的数据安全。 - 增强系统健壮性:增加防抖处理防止频繁 IO 触发重载。
This commit is contained in:
@@ -7,6 +7,8 @@ request:
|
||||
Content-Type: "application/json"
|
||||
Authorization: "111"
|
||||
host: "127.0.0.1:8080"
|
||||
body: >
|
||||
{}
|
||||
response:
|
||||
status: 200
|
||||
headers:
|
||||
@@ -20,4 +22,4 @@ response:
|
||||
"msg": "success"
|
||||
}
|
||||
settings:
|
||||
delay_ms: 200 # 模拟真实网络延迟
|
||||
delay_ms: 2000 # 模拟真实网络延迟
|
||||
Reference in New Issue
Block a user