Skip to content

Commit e4afa1d

Browse files
author
chilimannen
committed
Fix parameter count for web interface startup + longer overall timeout
1 parent 3874d33 commit e4afa1d

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/main/java/com/codingchili/ApplicationLauncher.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public ApplicationLauncher(String[] args) {
4444
if (done.succeeded()) {
4545
logger.info("Successfully started application");
4646

47-
if (args.length >= 2) {
47+
if (args.length > 1) {
4848
importFile(getFileName(), getIndexName());
4949
} else {
5050
MessageConsumer<?> consumer = vertx.eventBus().consumer(ES_STATUS);

src/main/java/com/codingchili/Controller/Website.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import com.codingchili.Model.ParserException;
88
import io.vertx.core.*;
99
import io.vertx.core.buffer.Buffer;
10+
import io.vertx.core.eventbus.DeliveryOptions;
1011
import io.vertx.ext.web.FileUpload;
1112
import io.vertx.ext.web.Router;
1213
import io.vertx.ext.web.handler.BodyHandler;
@@ -29,6 +30,7 @@
2930
*/
3031
public class Website extends AbstractVerticle {
3132
public static final String MAPPING = "mapping";
33+
private static final int INDEXING_TIMEOUT = 300000;
3234
private Logger logger = Logger.getLogger(getClass().getName());
3335
private static final String DONE = "/done";
3436
private static final String ERROR = "/error";
@@ -140,7 +142,9 @@ private void parse(Buffer buffer, MultiMap params, String fileName, Future<Integ
140142
int columnRow = Integer.parseInt(params.get(OFFSET));
141143
FileParser parser = new FileParser(buffer.getBytes(), columnRow, fileName);
142144
vertx.eventBus().send(Configuration.INDEXING_ELASTICSEARCH,
143-
parser.toImportable(params.get(INDEX), getMappingByParams(params)), reply -> {
145+
parser.toImportable(params.get(INDEX), getMappingByParams(params)),
146+
new DeliveryOptions().setSendTimeout(INDEXING_TIMEOUT),
147+
reply -> {
144148
if (reply.succeeded()) {
145149
blocking.complete(parser.getImportedItems());
146150
} else {

0 commit comments

Comments
 (0)