1
This commit is contained in:
@@ -10,12 +10,15 @@ const logs = require('../middleware/logProxy')
|
||||
*/
|
||||
class OSSToolService {
|
||||
constructor() {
|
||||
const { accessKeyId, accessKeySecret, bucket, region } = config.oos;
|
||||
const { accessKeyId, accessKeySecret, bucket, region, timeout } = config.oos;
|
||||
// 设置超时时间:默认30分钟(1800000ms),适用于大文件上传
|
||||
// 可以从配置文件读取,如果没有配置则使用默认值
|
||||
this.client = new OSS({
|
||||
region,
|
||||
accessKeyId,
|
||||
accessKeySecret,
|
||||
bucket,
|
||||
timeout: timeout || 30 * 60 * 1000, // 30分钟超时(1800000ms)
|
||||
})
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user