Documentations edited
Signed-off-by: Mert Can Bilgiç <mert.bilgic@trendyol.com>
This commit is contained in:
committed by
Mert Can Bilgiç
parent
2ebfe29d8a
commit
a10174b56d
@@ -21,7 +21,7 @@ import { EventEmitter } from 'events';
|
||||
const rootDir = os.platform() === 'win32' ? 'C:\\rootDir' : '/rootDir';
|
||||
|
||||
const checkFileExists = async (Key: string): Promise<boolean> => {
|
||||
// Key will always have / as file separator irrespective of OS since S3 expects /.
|
||||
// Key will always have / as file separator irrespective of OS since cloud providers expects /.
|
||||
// Normalize Key to OS specific path before checking if file exists.
|
||||
const filePath = path.join(rootDir, Key);
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ export class OpenStackSwiftPublish implements PublisherBase {
|
||||
} catch (error) {
|
||||
throw new Error(
|
||||
"Since techdocs.publisher.type is set to 'openStackSwift' in your app config, " +
|
||||
'techdocs.publisher.openStackSwift.containerName is required.',
|
||||
'techdocs.publisher.openStackSwift.containerName is required.',
|
||||
);
|
||||
}
|
||||
|
||||
@@ -80,9 +80,9 @@ export class OpenStackSwiftPublish implements PublisherBase {
|
||||
} else {
|
||||
logger.error(
|
||||
`Could not retrieve metadata about the OpenStack Swift container ${containerName}. ` +
|
||||
'Make sure the container exists. Also make sure that authentication is setup either by ' +
|
||||
'explicitly defining credentials and region in techdocs.publisher.openStackSwift in app config or ' +
|
||||
'by using environment variables. Refer to https://backstage.io/docs/features/techdocs/using-cloud-storage',
|
||||
'Make sure the container exists. Also make sure that authentication is setup either by ' +
|
||||
'explicitly defining credentials and region in techdocs.publisher.openStackSwift in app config or ' +
|
||||
'by using environment variables. Refer to https://backstage.io/docs/features/techdocs/using-cloud-storage',
|
||||
);
|
||||
|
||||
logger.error(`from OpenStack client library: ${err.message}`);
|
||||
@@ -138,16 +138,17 @@ export class OpenStackSwiftPublish implements PublisherBase {
|
||||
};
|
||||
|
||||
// Rate limit the concurrent execution of file uploads to batches of 10 (per publish)
|
||||
const uploadFile = limiter(() =>
|
||||
new Promise((res, rej) => {
|
||||
const writeStream = this.storageClient.upload(params);
|
||||
const uploadFile = limiter(
|
||||
() =>
|
||||
new Promise((res, rej) => {
|
||||
const writeStream = this.storageClient.upload(params);
|
||||
|
||||
writeStream.on('error', rej);
|
||||
writeStream.on('error', rej);
|
||||
|
||||
writeStream.on('success', res);
|
||||
writeStream.on('success', res);
|
||||
|
||||
readStream.pipe(writeStream);
|
||||
}),
|
||||
readStream.pipe(writeStream);
|
||||
}),
|
||||
);
|
||||
uploadPromises.push(uploadFile);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user