fix: non uploaded file not delete after delete folder
This commit is contained in:
parent
a797f0ddb4
commit
82836b1def
1 changed files with 13 additions and 0 deletions
|
|
@ -462,6 +462,19 @@ export class StorageController extends Controller {
|
|||
stream.on("error", () => reject(new Error(MINIO_ERROR_MESSAGE)));
|
||||
});
|
||||
|
||||
// delete file that is not uploaded
|
||||
await esClient.deleteByQuery({
|
||||
index: DEFAULT_INDEX,
|
||||
query: {
|
||||
bool: {
|
||||
must: {
|
||||
prefix: { pathname: stripLeadingSlash(`${body.path.join("/")}/`) },
|
||||
match: { upload: false },
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
io.getInstance()?.emit("FolderDelete", { pathname: body.path.join("/") + "/" });
|
||||
|
||||
return this.setStatus(HttpStatusCode.NO_CONTENT);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue