Files
jh-zz/README.md
2025-09-10 19:35:06 +08:00

45 lines
892 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
## TODO
此实现目前并不是完全并发安全的:
- 目前事务等级没有对 cityhash 表的 offset 字段做防丢失,并发操作可能会出问题
## 模块逻辑
**更新网关配置**
```
获取所有网关
获取所有配置
构建配置表 `map[网关][配置]`
循环配置:
如果配置项需要更新,记录更新信息
循环更新信息(加速数据库查询)
上传配置到云端
```
**同步节点信息(全量更新)**
```
获取所有启用城市
循环城市:
获取云端节点信息
获取本地节点信息
更新列表 = 空
删除列表 = 本地节点
循环云端节点:
更新列表 <= 云端节点
删除列表 x= 本地节点(同云端 macaddr
更新并(软)删除节点信息
```
### 统一节点调度
节点上下线:
提供一个接口用来为节点加解锁