Skip to content

Commit

Permalink
Too Many Open Files
Browse files Browse the repository at this point in the history
  • Loading branch information
silentbalanceyh committed Jun 2, 2023
1 parent ffeb6d2 commit 0317077
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 14 deletions.
12 changes: 2 additions & 10 deletions vertx-gaia/vertx-co/src/main/jib/io/horizon/spi/HorizonIoLoad.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,9 @@
import io.horizon.exception.internal.EmptyIoException;
import io.vertx.core.json.JsonObject;
import io.vertx.up.eon.configure.YmlCore;
import io.vertx.up.fn.Fn;
import io.vertx.up.runtime.ZeroStore;
import io.vertx.up.util.Ut;

import java.io.InputStream;

/**
* @author lang : 2023/4/28
*/
Expand All @@ -30,17 +27,12 @@ public Class<?> ofLogger() {

@Override
public JsonObject ofFailure() {
if (MESSAGE.isEmpty()) {
if (MESSAGE.isEmpty() && Ut.ioExist(FILENAME)) {
try {
final InputStream in = Fn.jvmOr(() -> Ut.ioStream(FILENAME));
// Do not throw out EmptyStreamException when up.god.file does not existing.
if (null != in) {
MESSAGE.mergeIn(Ut.ioYaml(FILENAME));
}
MESSAGE.mergeIn(Ut.ioYaml(FILENAME));
} catch (final EmptyIoException ex) {
// Ignore
}

}
return MESSAGE;
// // Pick up message from MESSAGE cache.
Expand Down
13 changes: 9 additions & 4 deletions vertx-gaia/vertx-up/src/main/web/io/vertx/up/ZeroLauncher.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import io.vertx.up.runtime.ZeroOption;
import io.vertx.up.util.Ut;

import java.util.Objects;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.function.Consumer;
Expand All @@ -28,11 +29,15 @@ public class ZeroLauncher implements HLauncher<Vertx> {

private static final ConcurrentMap<String, Vertx> VERTX = new ConcurrentHashMap<>();

private static Vertx VERTX_NATIVE;

public static Vertx nativeRef() {
final Vertx vertx = Vertx.vertx(VertxSetUp.nativeOption());
final EventBus eventBus = vertx.eventBus();
eventBus.registerDefaultCodec(Envelop.class, Ut.singleton(EnvelopCodec.class));
return vertx;
if (Objects.isNull(VERTX_NATIVE)) {
VERTX_NATIVE = Vertx.vertx(VertxSetUp.nativeOption());
final EventBus eventBus = VERTX_NATIVE.eventBus();
eventBus.registerDefaultCodec(Envelop.class, Ut.singleton(EnvelopCodec.class));
}
return VERTX_NATIVE;
}

@Override
Expand Down

0 comments on commit 0317077

Please sign in to comment.