Skip to content

Commit

Permalink
Merge branch 'master' into fixIndexAliasNaming
Browse files Browse the repository at this point in the history
  • Loading branch information
dr0i committed May 4, 2021
2 parents defcdf4 + 6c6564f commit 0d5e195
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions web/app/controllers/resources/Webhook.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,12 @@ 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_OF_BASEDUMP =
INDEX_NAME_OF_BASEDUMP + "-" + LocalDateTime.now()
.format(DateTimeFormatter.ofPattern("yyyyMMdd-kkmm"));
private static final String MSG_ETL_PROCESS_IS_ALREADY_RUNNING =
" because an ETL process is already running. Try again later!";
private static final String MSG_UPDATE_ALREADY_RUNNING =
"Couldn't update index '" + INDEX_NAME_OF_UPDATE
+ MSG_ETL_PROCESS_IS_ALREADY_RUNNING;
private static final String MSG_CREATE_INDEX_ALREADY_RUNNING =
"Couldn't created new index with name " + CREATE_INDEX_NAME_OF_BASEDUMP
+ MSG_ETL_PROCESS_IS_ALREADY_RUNNING;

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 @@ -90,6 +85,12 @@ public static Result basedumpAlma(final String GIVEN_TOKEN) {
if (!GIVEN_TOKEN.equals(TOKEN)) {
return wrongToken(KIND, GIVEN_TOKEN);
}
final String CREATE_INDEX_NAME_OF_BASEDUMP =
INDEX_NAME_OF_BASEDUMP + "-" + LocalDateTime.now()
.format(DateTimeFormatter.ofPattern("yyyyMMdd-kkmm"));
final String MSG_CREATE_INDEX_ALREADY_RUNNING =
"Couldn't created new index with name " + CREATE_INDEX_NAME_OF_BASEDUMP
+ MSG_ETL_PROCESS_IS_ALREADY_RUNNING;
if (AlmaMarcXml2lobidJsonEs.threadAlreadyStarted) {
sendMail(KIND, false, MSG_CREATE_INDEX_ALREADY_RUNNING);
return status(423, MSG_CREATE_INDEX_ALREADY_RUNNING);
Expand Down Expand Up @@ -125,4 +126,4 @@ private static void sendMail(final String KIND, final boolean SUCCESS,
}
}

}
}

0 comments on commit 0d5e195

Please sign in to comment.