Remove test code in main class, fix small issue in UserSessionUtils
This commit is contained in:
parent
1c64109862
commit
79a9f7770c
@ -103,9 +103,6 @@ import net.frozenorb.apiv3.serialization.jackson.UuidJsonDeserializer;
|
||||
import net.frozenorb.apiv3.serialization.jackson.UuidJsonSerializer;
|
||||
import net.frozenorb.apiv3.serialization.mongodb.UuidCodecProvider;
|
||||
import net.frozenorb.apiv3.util.EmailUtils;
|
||||
import net.frozenorb.apiv3.util.MojangUtils;
|
||||
import net.frozenorb.apiv3.util.SyncUtils;
|
||||
import net.frozenorb.apiv3.util.UserSessionUtils;
|
||||
import org.bson.Document;
|
||||
import org.bson.codecs.BsonValueCodecProvider;
|
||||
import org.bson.codecs.DocumentCodecProvider;
|
||||
@ -140,29 +137,6 @@ public final class APIv3 extends AbstractVerticle {
|
||||
setupMetrics();
|
||||
setupHttpServer();
|
||||
|
||||
UserSessionUtils.setupRedis();
|
||||
|
||||
try {
|
||||
Thread.sleep(2000L);
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
|
||||
UserSessionUtils.createSession(UUID.randomUUID(), "192.168.1.1", (v, i) -> {
|
||||
if (i == null) {
|
||||
System.out.println("a: " + v);
|
||||
} else {
|
||||
i.printStackTrace();
|
||||
}
|
||||
});
|
||||
UserSessionUtils.createSession(UUID.randomUUID(), "::1", (v, i) -> {
|
||||
if (i == null) {
|
||||
System.out.println("b: " + v);
|
||||
} else {
|
||||
i.printStackTrace();
|
||||
}
|
||||
});
|
||||
|
||||
/*User.findAll((users, error) -> {
|
||||
if (error != null) {
|
||||
error.printStackTrace();
|
||||
|
@ -42,12 +42,11 @@ public class UserSessionUtils {
|
||||
if (result.succeeded()) {
|
||||
redisClient.sadd("apiv3:sessions:" + user, key, (result2) -> {
|
||||
if (result2.succeeded()) {
|
||||
callback.onResult(null, null);
|
||||
callback.onResult(userSession, null);
|
||||
} else {
|
||||
callback.onResult(null, result2.cause());
|
||||
}
|
||||
});
|
||||
callback.onResult(null, null);
|
||||
} else {
|
||||
callback.onResult(null, result.cause());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user