mirror of
https://github.com/elyby/chrly.git
synced 2024-11-30 02:32:19 +05:30
Fix race condition, introduced in the previous commit
This commit is contained in:
parent
5b4761e4e5
commit
f872fe4698
@ -28,7 +28,6 @@ func CreateInMemoryTexturesStorage() *inMemoryTexturesStorage {
|
||||
storage := &inMemoryTexturesStorage{
|
||||
data: make(map[string]*inMemoryItem),
|
||||
}
|
||||
storage.Start()
|
||||
|
||||
return storage
|
||||
}
|
||||
|
@ -178,6 +178,8 @@ func TestInMemoryTexturesStorage_GarbageCollection(t *testing.T) {
|
||||
storage.StoreTextures("dead24f9a4fa4877b7b04c8c6c72bb46", textures1)
|
||||
storage.StoreTextures("b5d58475007d4f9e9ddd1403e2497579", textures2)
|
||||
|
||||
storage.Start()
|
||||
|
||||
time.Sleep(inMemoryStorageGCPeriod + time.Millisecond) // Let it start first iteration
|
||||
|
||||
_, textures1Err := storage.GetTextures("dead24f9a4fa4877b7b04c8c6c72bb46")
|
||||
|
@ -51,11 +51,13 @@ var serveCmd = &cobra.Command{
|
||||
return
|
||||
}
|
||||
|
||||
texturesStorage := queue.CreateInMemoryTexturesStorage()
|
||||
texturesStorage.Start()
|
||||
mojangTexturesQueue := &queue.JobsQueue{
|
||||
Logger: logger,
|
||||
Storage: &queue.SplittedStorage{
|
||||
UuidsStorage: mojangUuidsRepository,
|
||||
TexturesStorage: queue.CreateInMemoryTexturesStorage(),
|
||||
TexturesStorage: texturesStorage,
|
||||
},
|
||||
}
|
||||
logger.Info("Mojang's textures queue is successfully initialized")
|
||||
|
Loading…
Reference in New Issue
Block a user