@ccci/micro-server 1.0.49 → 1.0.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +15 -8
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -103691,14 +103691,21 @@ class Uploader {
|
|
|
103691
103691
|
constructor() {
|
|
103692
103692
|
}
|
|
103693
103693
|
static async init(options) {
|
|
103694
|
-
|
|
103695
|
-
Uploader.client
|
|
103696
|
-
|
|
103697
|
-
|
|
103698
|
-
|
|
103699
|
-
|
|
103700
|
-
|
|
103701
|
-
|
|
103694
|
+
try {
|
|
103695
|
+
if (!Uploader.client && Uploader.hasValidConfig(options)) {
|
|
103696
|
+
Logger.info("Connecting to minIO server...");
|
|
103697
|
+
Uploader.client = new Client({
|
|
103698
|
+
endPoint: options.minioHost,
|
|
103699
|
+
port: options.minioPort,
|
|
103700
|
+
useSSL: options.minioUseSSL,
|
|
103701
|
+
accessKey: options.minioAccessKey,
|
|
103702
|
+
secretKey: options.minioSecretKey
|
|
103703
|
+
});
|
|
103704
|
+
Logger.info("minio client:", Uploader.client);
|
|
103705
|
+
}
|
|
103706
|
+
} catch (error) {
|
|
103707
|
+
Logger.error(error);
|
|
103708
|
+
throw error;
|
|
103702
103709
|
}
|
|
103703
103710
|
}
|
|
103704
103711
|
static hasValidConfig(options) {
|