Skip to content

Commit

Permalink
ura
Browse files Browse the repository at this point in the history
  • Loading branch information
DmitriyKomarovCoder committed Nov 13, 2023
1 parent 626dfa5 commit 8b0ba7c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion cmd/api/init/router/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func InitRouter(auth *auth.Handler,
r.Use(middleware.RequestID)
r.Use(logMid.LoggingMiddleware)
r.Use(recoveryMid.Recoverer)
r.Use(middleware.Timeout(10000 * time.Second))
r.Use(middleware.Timeout(5 * time.Second))
r.Use(middleware.Heartbeat("ping"))

http.Handle("/", r)
Expand Down
2 changes: 1 addition & 1 deletion cmd/api/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import (
// @name session_id

func main() {
ctx, cancel := context.WithTimeout(context.Background(), 1000*time.Second)
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
defer cancel()

log := logger.NewLogger(ctx)
Expand Down
12 changes: 6 additions & 6 deletions internal/common/logger/logging.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ type Logger struct {
}

func NewLogger(ctx context.Context) *Logger {
//logFolderPath := "logs"
logFolderPath := "logs"
l := logrus.New()

l.SetReportCaller(true)
Expand All @@ -110,13 +110,13 @@ func NewLogger(ctx context.Context) *Logger {
},
}

// err := os.MkdirAll(logFolderPath, 0755)
// if err != nil {
// panic(err)
// }
err := os.MkdirAll(logFolderPath, 0755)
if err != nil {
panic(err)
}

lumber := &lumberjack.Logger{
//Filename: logFolderPath + "/server.log",
Filename: logFolderPath + "/server.log",
MaxSize: 30,
MaxAge: 2,
Compress: false,
Expand Down

0 comments on commit 8b0ba7c

Please sign in to comment.