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) {
|
||||
IpIntel newIpIntel = new IpIntel(id, maxMindResult);
|
||||
|
||||
ipIntelCollection.insertOne(newIpIntel, (ignored, error3) -> {
|
||||
ipIntelCollection.insertOne(newIpIntel, SyncUtils.vertxWrap((ignored, error3) -> {
|
||||
if (error3 != null) {
|
||||
callback.onResult(null, error3);
|
||||
} else {
|
||||
callback.onResult(newIpIntel, null);
|
||||
}
|
||||
});
|
||||
}));
|
||||
} else {
|
||||
// MaxMind failed to return result
|
||||
callback.onResult(null, null);
|
||||
|
Loading…
Reference in New Issue
Block a user