fix: logger race (#1339)

- Refactor logger using sync.Once to improve performance
- Initiate log setup in a goroutine to prevent blocking
- Integrate gin.DefaultErrorWriter and gin.DefaultWriter for logging
- Introduce request ID generation for better request tracking
- Simplify setup logic by removing redundant variables and code
This commit is contained in:
Laisky.Cai
2024-04-21 14:35:51 +08:00
committed by GitHub
parent 35ba1da984
commit a873cbd392
2 changed files with 17 additions and 29 deletions

View File

@@ -16,7 +16,7 @@ import (
)
// Regex to match data URL pattern
var dataURLPattern = regexp.MustCompile(`data:image/([^;]+);base64,(.*)`)
var dataURLPattern = regexp.MustCompile(`data:image/([^;]+);base64,(.*)`)
func IsImageUrl(url string) (bool, error) {
resp, err := http.Head(url)