feat: add warning log
This commit is contained in:
parent
132e1e9acd
commit
6dcbfea30a
1 changed files with 4 additions and 1 deletions
|
|
@ -44,7 +44,10 @@ export async function handler(key: string, event: string): Promise<boolean> {
|
|||
try {
|
||||
const stat = await minioClient.statObject(bucket, pathname);
|
||||
cachedMetadata[key] = { size: stat.size, type: stat.metaData["content-type"] };
|
||||
if (stat.size > 1024 * 1024 * 100) cachedBuffer[key] = Buffer.from([]);
|
||||
if (stat.size > 1024 * 1024 * 100) {
|
||||
console.warn("[AMQ] File is too large. Data extract will be skipped.");
|
||||
cachedBuffer[key] = Buffer.from([]);
|
||||
}
|
||||
} catch (e: any) {
|
||||
if (e.code === "NoSuchKey") {
|
||||
console.info(`[AMQ] Key: ${key} received but cannot be found.`);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue