From 2883756d73c36f128fc95df012290baab721fae2 Mon Sep 17 00:00:00 2001 From: lwl0608 Date: Mon, 6 May 2024 17:36:16 +0800 Subject: [PATCH] add hwcdn01 --- library/logger/logger.go | 2 +- library/mediafiller/mediafiller.go | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/library/logger/logger.go b/library/logger/logger.go index dfbb4a63..a41e68f7 100644 --- a/library/logger/logger.go +++ b/library/logger/logger.go @@ -78,7 +78,7 @@ func InitLogger(config configcenter.LoggerConfig) { rotatelogs.WithLinkName(config.FileAbsPath), rotatelogs.WithMaxAge(time.Duration(86400*7)*time.Second), rotatelogs.WithRotationTime(time.Duration(86400)*time.Second), - rotatelogs.WithRotationSize(1024*1024*500), + //rotatelogs.WithRotationSize(1024*1024*500), ) var writers io.Writer diff --git a/library/mediafiller/mediafiller.go b/library/mediafiller/mediafiller.go index df738d07..ab17fd8d 100644 --- a/library/mediafiller/mediafiller.go +++ b/library/mediafiller/mediafiller.go @@ -41,11 +41,12 @@ func SetFileServerDomainName(fileServerDomainName string) { } func (p *MediaFiller) GetFileServerDomain() string { - // cdn测试 - //if rand.Intn(100) < 20 { + if rand.Intn(100) < 5 { + return "https://filecdnhw01.tiefen.fun/" + } return "https://filecdn01.tiefen.fun/" - //} - return defaultMediaFiller.fileServerDomainName + + //return defaultMediaFiller.fileServerDomainName } func FillEntity(ctx *gin.Context, entity MediaFillable) error {