Properly wrap mongo call in IpIntel#findOrCreateById in vertx callback
This commit is contained in:
parent
fece3e0265
commit
628c8d656b
@ -49,13 +49,13 @@ public final class IpIntel {
|
|||||||
} else if (maxMindResult != null) {
|
} else if (maxMindResult != null) {
|
||||||
IpIntel newIpIntel = new IpIntel(id, maxMindResult);
|
IpIntel newIpIntel = new IpIntel(id, maxMindResult);
|
||||||
|
|
||||||
ipIntelCollection.insertOne(newIpIntel, (ignored, error3) -> {
|
ipIntelCollection.insertOne(newIpIntel, SyncUtils.vertxWrap((ignored, error3) -> {
|
||||||
if (error3 != null) {
|
if (error3 != null) {
|
||||||
callback.onResult(null, error3);
|
callback.onResult(null, error3);
|
||||||
} else {
|
} else {
|
||||||
callback.onResult(newIpIntel, null);
|
callback.onResult(newIpIntel, null);
|
||||||
}
|
}
|
||||||
});
|
}));
|
||||||
} else {
|
} else {
|
||||||
// MaxMind failed to return result
|
// MaxMind failed to return result
|
||||||
callback.onResult(null, null);
|
callback.onResult(null, null);
|
||||||
|
Loading…
Reference in New Issue
Block a user