RED-3880: Fixed index migration, always shutdown if migrate only
This commit is contained in:
parent
113b575b3a
commit
cdaddb3399
@ -33,13 +33,15 @@ public class MigrationStarterService {
|
||||
public void migrate() throws JsonProcessingException {
|
||||
|
||||
// This can only run in post upgrade hook, because otherwise the old service is still runnnig.
|
||||
if (settings.isMigrateOnly() && indexInformationService.hasIndexChanged()) {
|
||||
log.info("Index has changed and will be closed, dropped, recreated and all files will be indexed");
|
||||
String indexMessage = objectMapper.writeValueAsString(IndexMessage.builder().messageType(IndexMessageType.DROP).build());
|
||||
indexingMessageReceiver.receiveIndexingRequest(indexMessage);
|
||||
if (settings.isMigrateOnly()) {
|
||||
if (indexInformationService.hasIndexChanged()) {
|
||||
log.info("Index has changed and will be closed, dropped, recreated and all files will be indexed");
|
||||
String indexMessage = objectMapper.writeValueAsString(IndexMessage.builder()
|
||||
.messageType(IndexMessageType.DROP)
|
||||
.build());
|
||||
indexingMessageReceiver.receiveIndexingRequest(indexMessage);
|
||||
}
|
||||
System.exit(SpringApplication.exit(ctx, () -> 0));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user