import-qduoj: fix

This commit is contained in:
undefined committed 2021-01-17 09:29:35 +08:00
1 parent 991ffa6c86
commit 84d7e1b95d
6 files changed
+18 -13

No files matched your search

+4 -4
View File
@@ -1,6 +1,6 @@
{
"name": "hydrooj",
"version": "2.15.21",
"version": "2.15.22",
"bin": "bin/hydrooj.js",
"main": "dist/loader.js",
"typings": "dist/loader.d.ts",
@@ -32,8 +32,8 @@
"serialize-javascript": "^5.0.1",
"sockjs": "^0.3.20",
"superagent": "^6.1.0",
"systeminformation": "^4.34.5",
"terminal-kit": "^1.44.3",
"systeminformation": "^4.34.7",
"terminal-kit": "^1.45.4",
"yargs": "^16.2.0"
},
"devDependencies": {
@@ -45,7 +45,7 @@
"@types/koa-static-cache": "^5.1.0",
"@types/lodash": "^4.14.167",
"@types/lru-cache": "^5.1.0",
"@types/minio": "^7.0.6",
"@types/minio": "^7.0.7",
"@types/mongodb": "^3.5.33",
"@types/nodemailer": "^6.4.0",
"@types/serialize-javascript": "^5.0.0",
+2 -1
View File
@@ -2,6 +2,7 @@ import { Readable } from 'stream';
import assert from 'assert';
import { URL } from 'url';
import { Client, BucketItem, ItemBucketMetadata } from 'minio';
import { createReadStream } from 'fs-extra';
import { Logger } from '../logger';
import { streamToBuffer } from '../utils';
@@ -103,7 +104,7 @@ class StorageService {
}
async put(target: string, file: string | Buffer | Readable, meta: ItemBucketMetadata = {}) {
if (typeof file === 'string') return await this.client.fPutObject(this.opts.bucket, target, file, meta);
if (typeof file === 'string') file = createReadStream(file);
return await this.client.putObject(this.opts.bucket, target, file, meta);
}