This commit is contained in:
Tom Moor
2023-01-29 06:28:57 -08:00
committed by GitHub
parent f0d9bb4898
commit 85ca25371c
9 changed files with 46 additions and 29 deletions

View File

@@ -58,6 +58,9 @@ class FileOperation extends IdModel {
@Column(DataType.BIGINT)
size: number;
/**
* Mark the current file operation as expired and remove the file from storage.
*/
expire = async function () {
this.state = "expired";
try {
@@ -70,7 +73,10 @@ class FileOperation extends IdModel {
await this.save();
};
get buffer() {
/**
* The file operation contents as a readable stream.
*/
get stream() {
return getFileByKey(this.key);
}