mirror of
https://github.com/KaySar12/NextZen-UserService.git
synced 2025-10-06 19:59:42 +07:00
fix sqlite db lock by reducing maximum open connections to 1 (#26)
This commit is contained in:
+1
-1
@@ -36,7 +36,7 @@ func GetDb(dbPath string) *gorm.DB {
|
|||||||
|
|
||||||
c, _ := db.DB()
|
c, _ := db.DB()
|
||||||
c.SetMaxIdleConns(10)
|
c.SetMaxIdleConns(10)
|
||||||
c.SetMaxOpenConns(100)
|
c.SetMaxOpenConns(1)
|
||||||
c.SetConnMaxIdleTime(time.Second * 1000)
|
c.SetConnMaxIdleTime(time.Second * 1000)
|
||||||
|
|
||||||
gdb = db
|
gdb = db
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ func (s *UserService) GetEvents(ctx echo.Context, params codegen.GetEventsParams
|
|||||||
list := service.MyService.Event().GetEvents()
|
list := service.MyService.Event().GetEvents()
|
||||||
return ctx.JSON(http.StatusOK, list)
|
return ctx.JSON(http.StatusOK, list)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *UserService) DeleteEventBySerial(ctx echo.Context, serial codegen.Serial) error {
|
func (s *UserService) DeleteEventBySerial(ctx echo.Context, serial codegen.Serial) error {
|
||||||
service.MyService.Event().DeleteEventBySerial(serial)
|
service.MyService.Event().DeleteEventBySerial(serial)
|
||||||
return ctx.JSON(http.StatusOK, serial)
|
return ctx.JSON(http.StatusOK, serial)
|
||||||
|
|||||||
Reference in New Issue
Block a user