Make converter changes for push to production
This commit is contained in:
parent
eb03636a6b
commit
f9a423b457
@ -39,7 +39,8 @@ public final class V2Importer {
|
|||||||
|
|
||||||
importFrom.getCollection("punishment").find().forEach(new PunishmentConverter(oidToUniqueId), new MongoToVertxCallback<>(punishmentsFuture));
|
importFrom.getCollection("punishment").find().forEach(new PunishmentConverter(oidToUniqueId), new MongoToVertxCallback<>(punishmentsFuture));
|
||||||
importFrom.getCollection("grant").find().forEach(new GrantConverter(oidToUniqueId), new MongoToVertxCallback<>(grantsFuture));
|
importFrom.getCollection("grant").find().forEach(new GrantConverter(oidToUniqueId), new MongoToVertxCallback<>(grantsFuture));
|
||||||
importFrom.getCollection("iplog").find().forEach(new IpLogConverter(oidToUniqueId), new MongoToVertxCallback<>(ipLogFuture));
|
//importFrom.getCollection("iplog").find().forEach(new IpLogConverter(oidToUniqueId), new MongoToVertxCallback<>(ipLogFuture));
|
||||||
|
ipLogFuture.complete();
|
||||||
|
|
||||||
CompositeFuture.all(punishmentsFuture, grantsFuture, ipLogFuture).setHandler((result) -> {
|
CompositeFuture.all(punishmentsFuture, grantsFuture, ipLogFuture).setHandler((result) -> {
|
||||||
if (result.succeeded()) {
|
if (result.succeeded()) {
|
||||||
|
@ -36,11 +36,13 @@ public final class GrantConverter implements Block<Document> {
|
|||||||
if (rank.equalsIgnoreCase("unban") || rank.equalsIgnoreCase("pass") || rank.equalsIgnoreCase("pink") || rank.equalsIgnoreCase("jrdev")) {
|
if (rank.equalsIgnoreCase("unban") || rank.equalsIgnoreCase("pass") || rank.equalsIgnoreCase("pink") || rank.equalsIgnoreCase("jrdev")) {
|
||||||
return;
|
return;
|
||||||
} else if (rank.equalsIgnoreCase("high_roller")) {
|
} else if (rank.equalsIgnoreCase("high_roller")) {
|
||||||
rank = "high-roller";
|
rank = "highroller";
|
||||||
} else if (rank.equalsIgnoreCase("dev")) {
|
} else if (rank.equalsIgnoreCase("dev")) {
|
||||||
rank = "developer";
|
rank = "developer";
|
||||||
} else if (rank.equalsIgnoreCase("coowner")) {
|
} else if (rank.equalsIgnoreCase("coowner")) {
|
||||||
rank = "owner";
|
rank = "owner";
|
||||||
|
} else if (rank.equalsIgnoreCase("youtuber")) {
|
||||||
|
rank = "famous";
|
||||||
}
|
}
|
||||||
|
|
||||||
Grant created = new Grant(
|
Grant created = new Grant(
|
||||||
|
@ -9,9 +9,11 @@ import net.frozenorb.apiv3.util.SyncUtils;
|
|||||||
import org.bson.Document;
|
import org.bson.Document;
|
||||||
import org.bson.types.ObjectId;
|
import org.bson.types.ObjectId;
|
||||||
|
|
||||||
|
import java.time.Instant;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public final class PunishmentConverter implements Block<Document> {
|
public final class PunishmentConverter implements Block<Document> {
|
||||||
@ -36,6 +38,12 @@ public final class PunishmentConverter implements Block<Document> {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Instant twoWeeks = Instant.now().minusSeconds(TimeUnit.DAYS.toSeconds(14));
|
||||||
|
|
||||||
|
if (punishment.getDate("created").toInstant().isBefore(twoWeeks)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Punishment created = new Punishment(
|
Punishment created = new Punishment(
|
||||||
new ObjectId().toString(),
|
new ObjectId().toString(),
|
||||||
target,
|
target,
|
||||||
|
Loading…
Reference in New Issue
Block a user