mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-11-10 02:23:43 +08:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user