Add file_retention parameter to upload test

Introduces the 'file_retention' field with a value of 30,000 to the upload test payload in OneBotUploadTester. This may be used to specify file retention duration in milliseconds.
This commit is contained in:
手瓜一十雪
2025-09-20 16:19:39 +08:00
parent 9b88946209
commit 937be7678e
2 changed files with 7 additions and 6 deletions

View File

@@ -250,7 +250,7 @@ export class UploadFileStream extends OneBotAction<Payload, StreamPacket<StreamR
if (stream.fileRetention && stream.fileRetention > 0) {
setTimeout(() => {
unlink(finalPath, err => {
this.core.context.logger.logError(`Failed to delete retained file ${finalPath}:`, err);
if (err) this.core.context.logger.logError(`Failed to delete retained file ${finalPath}:`, err);
});
}, stream.fileRetention);
}