Compare commits

...

2 Commits

Author SHA1 Message Date
5e25e8eccc fix(with/etcd): 修改Etcd配置为空时的处理逻辑
当Etcd配置或端点为空时,将panic改为直接返回,避免程序崩溃
2025-09-20 11:08:47 +08:00
4f584726d6 ```
refactor(with): 调整Memory函数参数顺序

将Memory函数的参数顺序从(opts, cli)调整为(cli, opts),
使函数签名更加符合常规的客户端优先参数排列习惯,
提升代码可读性和一致性。
```
2025-09-20 10:59:45 +08:00
2 changed files with 2 additions and 2 deletions

View File

@@ -13,7 +13,7 @@ import (
func Etcd(cfg *conf.EtcdConf, cli *clientv3.Client) {
if cfg == nil || len(cfg.Endpoints) == 0 {
panic("Etcd endpoints is Empty!")
return
}
etcdCfg := clientv3.Config{

View File

@@ -10,7 +10,7 @@ import (
"github.com/allegro/bigcache/v3"
)
func Memory(opts *bigcache.Config, cli *bigcache.BigCache) {
func Memory(cli *bigcache.BigCache, opts *bigcache.Config) {
config := bigcache.Config{
Shards: 1024,
LifeWindow: 10 * time.Minute,