adjust latency periods, display form for -1

This commit is contained in:
2024-12-17 08:23:19 -06:00
parent 6c00da29a7
commit 63208ee203
2 changed files with 6 additions and 2 deletions

View File

@@ -162,9 +162,11 @@ func (l *LatencyQueue) Start(ctx context.Context) {
// Store the result in Redis
value := "timeout"
expiration := time.Hour*24 + time.Minute*time.Duration(rand.Intn(60*8))
expiration := time.Hour*8 + time.Minute*time.Duration(rand.Intn(60*8))
if success {
value = results.AvgRtt.String()
} else {
expiration = time.Hour*4 + time.Minute*time.Duration(rand.Intn(60*4))
}
l.logger.Debugw("Ping Result", "ip", ip, "latency", value)

View File

@@ -30,7 +30,9 @@ export default function Offer({
<span className="text-sm">{mb_to_gb(offer.gpu_ram)} GB</span>
</span>
<span className="relative top-3 text-base">
<span>{latency ?? "?"}</span>
<span className={latency == -1 ? "text-red-500" : ""}>
{latency == -1 ? "??" : latency}
</span>
<span className="text-xs select-none">ms</span>
</span>
</div>