Properly wrap mongo call in IpIntel#findOrCreateById in vertx callback

This commit is contained in:
Colin McDonald 2016-07-16 16:51:07 -04:00
parent fece3e0265
commit 628c8d656b
1 changed files with 2 additions and 2 deletions

View File

@ -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);