mirror of
https://github.com/elyby/chrly.git
synced 2025-05-31 14:11:51 +05:30
#1: Implemented in-memory storage for textures
This commit is contained in:
@@ -13,7 +13,7 @@ import (
|
||||
|
||||
var usernamesToUuids = mojang.UsernamesToUuids
|
||||
var uuidToTextures = mojang.UuidToTextures
|
||||
var delay = time.Second
|
||||
var uuidsQueuePeriod = time.Second
|
||||
var forever = func() bool {
|
||||
return true
|
||||
}
|
||||
@@ -81,11 +81,11 @@ func (ctx *JobsQueue) GetTexturesForUsername(username string) chan *mojang.Signe
|
||||
|
||||
func (ctx *JobsQueue) startQueue() {
|
||||
go func() {
|
||||
time.Sleep(delay)
|
||||
time.Sleep(uuidsQueuePeriod)
|
||||
for forever() {
|
||||
start := time.Now()
|
||||
ctx.queueRound()
|
||||
time.Sleep(delay - time.Since(start))
|
||||
time.Sleep(uuidsQueuePeriod - time.Since(start))
|
||||
}
|
||||
}()
|
||||
}
|
||||
|
Reference in New Issue
Block a user