Skip to content

Commit

Permalink
Fix create name of index
Browse files Browse the repository at this point in the history
Don't create the index name when starting the app but when starting
the ETl of basedump.

See #1159.
  • Loading branch information
dr0i committed Apr 26, 2021
1 parent 72ad8d6 commit 5caa61d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion web/app/controllers/resources/Webhook.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ public class Webhook extends Controller {
private static final String INDEX_BASEDUMP_ALIAS_SUFFIX = "-staging";
private static final String UPDATE_NEWEST_INDEX = "exact";
private static final String CREATE_INDEX = "create";
private static final String CREATE_INDEX_NAME = INDEX_NAME + "-" + LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMdd-kkmm"));
private static final String MORPH_FILENAME = "alma.xml";
// If null, create default values from Global settings
public static String clusterHost = null;
Expand Down Expand Up @@ -78,6 +77,7 @@ public static Result basedumpAlma(final String GIVEN_TOKEN) {
if (!GIVEN_TOKEN.equals(TOKEN)) {
return wrongToken(KIND, GIVEN_TOKEN);
}
String CREATE_INDEX_NAME = INDEX_NAME + "-" + LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMdd-kkmm"));
if (AlmaMarcXml2lobidJsonEs.threadAlreadyStarted){
sendMail(KIND, false, "Couldn't created new index with name "+ CREATE_INDEX_NAME + " because an ETL process is already running. Try again later!");
return status(423, MSG_ALREADY_RUNNING);
Expand Down

0 comments on commit 5caa61d

Please sign in to comment.