fix: get config

This commit is contained in:
lilong.129
2025-03-04 19:39:38 +08:00
parent d50b1f9855
commit e35aa782c2
10 changed files with 56 additions and 40 deletions

View File

@@ -276,7 +276,7 @@ var (
func DownloadFileByUrl(fileUrl string) (filePath string, err error) {
hash := md5.Sum([]byte(fileUrl))
fileName := fmt.Sprintf("%x", hash)
filePath = filepath.Join(config.DownloadsPath, fileName)
filePath = filepath.Join(config.GetConfig().DownloadsPath, fileName)
// get or create file lock
lockI, _ := fileLocks.LoadOrStore(filePath, &sync.Mutex{})