Skip to content

Commit

Permalink
test brain overload decrease
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasCAI-mlv committed Aug 12, 2024
1 parent faaf3cd commit 1c27eb9
Showing 1 changed file with 24 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -183,32 +183,33 @@ public Mono<HttpResponse<Void>> delete(String namespace, @PathVariable String su
.deleteAllVersions(ns, subject)
.map(deletedVersionIds -> HttpResponse.noContent());
});

}

// delete a specific version of the schema
} else {
return schemaService.getSubject(ns, subject, version.get())
.map(Optional::of)
.defaultIfEmpty(Optional.empty())
.flatMap(subjectOptional -> {
if (subjectOptional.isEmpty()) {
return Mono.just(HttpResponse.notFound());
}
return schemaService.getSubject(ns, subject, version.get())
.map(Optional::of)
.defaultIfEmpty(Optional.empty())
.flatMap(subjectOptional -> {
if (subjectOptional.isEmpty()) {
return Mono.just(HttpResponse.notFound());
}

if (dryrun) {
return Mono.just(HttpResponse.noContent());
}
if (dryrun) {
return Mono.just(HttpResponse.noContent());
}

Schema schemaVersionToDelete = subjectOptional.get();
return schemaService
.deleteVersion(ns, subject, version.get())
.flatMap(optionalLatestSubject -> {
sendEventLog(schemaVersionToDelete,
optionalLatestSubject.isEmpty() ? ApplyStatus.deleted : ApplyStatus.changed,
schemaVersionToDelete.getSpec(),
optionalLatestSubject.isEmpty() ? null : optionalLatestSubject.get().getSpec());
return Mono.just(HttpResponse.noContent());
});
});
}
Schema schemaVersionToDelete = subjectOptional.get();
return schemaService
.deleteVersion(ns, subject, version.get())
.flatMap(optionalLatestSubject -> {
sendEventLog(schemaVersionToDelete,
optionalLatestSubject.isEmpty() ? ApplyStatus.deleted : ApplyStatus.changed,
schemaVersionToDelete.getSpec(),
optionalLatestSubject.isEmpty() ? null : optionalLatestSubject.get().getSpec());
return Mono.just(HttpResponse.noContent());
});
});
}

/**
Expand Down

0 comments on commit 1c27eb9

Please sign in to comment.