Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
D-D-H committed Feb 24, 2024
1 parent acbd44c commit b4d5975
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -158,11 +158,13 @@ public void deleteById(long fileId) {
FileEntity file = getFileEntityByIdAndCheckAuthority(fileId);

if (isMaster()) {
// forward the request to the static worker
FileStaticWorkerBindEntity bind = fileStaticWorkerBindRepo.findByFileId(file.getId()).orElseThrow(() -> CE(INTERNAL_ERROR));
workerService.syncRequest(bind.getStaticWorker(),
createDeleteRequest("/files/" + fileId, null, Void.class));
return;
Optional<FileStaticWorkerBindEntity> optional = fileStaticWorkerBindRepo.findByFileId(file.getId());
if (optional.isPresent()) {
// forward the request to the static worker
workerService.syncRequest(optional.get().getStaticWorker(),
createDeleteRequest("/files/" + fileId, null, Void.class));
return;
}
}

doDelete(file);
Expand Down

0 comments on commit b4d5975

Please sign in to comment.