Skip to content

Commit

Permalink
提高上传稳定性
Browse files Browse the repository at this point in the history
  • Loading branch information
MarSeventh committed Nov 6, 2024
1 parent a149d88 commit 2aa7094
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions functions/upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,10 @@ export async function onRequestPost(context) { // Contents of context object
});
} catch (error) {
console.error('Moderate Error:', error);
// 将不带审查的图片写入数据库
await env.img_url.put(fullId, "", {
metadata: { FileName: fileName, FileType: fileType, ListType: "None", Label: "None", TimeStamp: time, Channel: "CloudflareR2", UploadIP: uploadIp },
});
} finally {
console.log('Moderate Done');
}
Expand Down Expand Up @@ -262,6 +266,10 @@ export async function onRequestPost(context) { // Contents of context object
});
} catch (error) {
console.error('Moderate Error:', error);
// 将不带审查的图片写入数据库
await env.img_url.put(fullId, "", {
metadata: { FileName: fileName, FileType: fileType, ListType: "None", Label: "None", TimeStamp: time, Channel: "TelegramNew", TgFileId: id, UploadIP: uploadIp },
});
} finally {
console.log('Moderate Done');
}
Expand Down

0 comments on commit 2aa7094

Please sign in to comment.