add server pinger
Some checks failed
ci / deploy (push) Failing after 1m3s

This commit is contained in:
Lee
2024-04-10 07:43:38 +01:00
parent 25c69e11e1
commit fcb8ef0357
40 changed files with 1751 additions and 0 deletions

View File

@ -0,0 +1,31 @@
package cc.fascinated.model.cache;
import cc.fascinated.model.server.MinecraftServer;
import lombok.*;
import org.springframework.data.annotation.Id;
import org.springframework.data.redis.core.RedisHash;
import java.io.Serializable;
/**
* @author Braydon
*/
@AllArgsConstructor @Setter @Getter @ToString
@RedisHash(value = "server", timeToLive = 60L) // 1 minute (in seconds)
public final class CachedMinecraftServer implements Serializable {
/**
* The id of this cached server.
*/
@Id @NonNull private transient final String id;
/**
* The cached server.
*/
@NonNull private final MinecraftServer value;
/**
* The unix timestamp of when this
* server was cached, -1 if not cached.
*/
private long cached;
}