mirror of
https://github.com/halejohn/Cloudreve.git
synced 2026-01-26 09:34:57 +08:00
Feat: RWMutex / reload for aira2
This commit is contained in:
@@ -41,9 +41,13 @@ func (service *AddURLService) Add(c *gin.Context, taskType int) serializer.Respo
|
||||
UserID: fs.User.ID,
|
||||
Source: service.URL,
|
||||
}
|
||||
|
||||
aria2.Lock.RLock()
|
||||
if err := aria2.Instance.CreateTask(task, fs.User.Group.OptionsSerialized.Aria2Options); err != nil {
|
||||
aria2.Lock.RUnlock()
|
||||
return serializer.Err(serializer.CodeNotSet, "任务创建失败", err)
|
||||
}
|
||||
aria2.Lock.RUnlock()
|
||||
|
||||
return serializer.Response{}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user