mirror of
https://github.com/usememos/memos.git
synced 2025-06-05 22:09:59 +02:00
chore: update db utils (#2177)
This commit is contained in:
@ -42,11 +42,16 @@ var (
|
||||
Run: func(_cmd *cobra.Command, _args []string) {
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
db := db.NewDB(profile)
|
||||
if err := db.Open(ctx); err != nil {
|
||||
if err := db.Open(); err != nil {
|
||||
cancel()
|
||||
log.Error("failed to open db", zap.Error(err))
|
||||
return
|
||||
}
|
||||
if err := db.Migrate(ctx); err != nil {
|
||||
cancel()
|
||||
log.Error("failed to migrate db", zap.Error(err))
|
||||
return
|
||||
}
|
||||
|
||||
store := store.New(db.DBInstance, profile)
|
||||
s, err := server.NewServer(ctx, profile, store)
|
||||
|
Reference in New Issue
Block a user