diff --git a/CHANGELOG.md b/CHANGELOG.md index 2484c82..8b9a8c0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [Unreleased] +## [Unreleased] - xxxx-xx-xx + +## [4.2.2] - 2019-06-19 +### Fixed +- GC for in-memory textures cache has not been initialized. ## [4.2.1] - 2019-05-06 ### Changed @@ -57,6 +61,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 from the textures link instead. - `hash` field from `POST /api/skins` endpoint. -[Unreleased]: https://github.com/elyby/chrly/compare/4.2.1...HEAD +[Unreleased]: https://github.com/elyby/chrly/compare/4.2.2...HEAD +[4.2.2]: https://github.com/elyby/chrly/compare/4.2.1...4.2.2 [4.2.1]: https://github.com/elyby/chrly/compare/4.2.0...4.2.1 [4.2.0]: https://github.com/elyby/chrly/compare/4.1.1...4.2.0 diff --git a/api/mojang/queue/in_memory_textures_storage.go b/api/mojang/queue/in_memory_textures_storage.go index 1b8bc00..cb7d8a3 100644 --- a/api/mojang/queue/in_memory_textures_storage.go +++ b/api/mojang/queue/in_memory_textures_storage.go @@ -25,9 +25,11 @@ type inMemoryTexturesStorage struct { } func CreateInMemoryTexturesStorage() *inMemoryTexturesStorage { - return &inMemoryTexturesStorage{ + storage := &inMemoryTexturesStorage{ data: make(map[string]*inMemoryItem), } + + return storage } func (s *inMemoryTexturesStorage) Start() { diff --git a/cmd/serve.go b/cmd/serve.go index bc72be8..c0c7bf9 100644 --- a/cmd/serve.go +++ b/cmd/serve.go @@ -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")