修改infra除repository包
This commit is contained in:
@@ -386,7 +386,7 @@ func initNotifyService(
|
||||
// initStorage 封装了数据库的初始化、连接和迁移逻辑。
|
||||
func initStorage(ctx context.Context, cfg config.DatabaseConfig) (database.Storage, error) {
|
||||
// 创建存储实例
|
||||
storage := database.NewStorage(cfg, logs.AddCompName(context.Background(), "Storage"))
|
||||
storage := database.NewStorage(logs.AddCompName(context.Background(), "Storage"), cfg)
|
||||
if err := storage.Connect(); err != nil {
|
||||
// 错误已在 Connect 内部被记录,这里只需包装并返回
|
||||
return nil, fmt.Errorf("数据库连接失败: %w", err)
|
||||
|
||||
Reference in New Issue
Block a user