Compare commits

..

4 Commits
4.2.1 ... 4.2.2

Author SHA1 Message Date
ErickSkrauch
0cfed45b64 Prepare 4.2.2 release 2019-06-19 01:02:41 +03:00
ErickSkrauch
f872fe4698 Fix race condition, introduced in the previous commit 2019-06-19 00:56:09 +03:00
ErickSkrauch
5b4761e4e5 Fixes #9. Start GC loop for in-memory textures cache. 2019-06-18 23:34:16 +03:00
ErickSkrauch
e81ca1520d Add codecov shield [skip ci] 2019-05-06 17:26:55 +03:00
4 changed files with 16 additions and 4 deletions

View File

@@ -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/), 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). 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 ## [4.2.1] - 2019-05-06
### Changed ### Changed
@@ -57,6 +61,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
from the textures link instead. from the textures link instead.
- `hash` field from `POST /api/skins` endpoint. - `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.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 [4.2.0]: https://github.com/elyby/chrly/compare/4.1.1...4.2.0

View File

@@ -2,6 +2,7 @@
[![Written in Go][ico-lang]][link-go] [![Written in Go][ico-lang]][link-go]
[![Build Status][ico-build]][link-build] [![Build Status][ico-build]][link-build]
[![Coverage][ico-coverage]][link-coverage]
[![Keep a Changelog][ico-changelog]](CHANGELOG.md) [![Keep a Changelog][ico-changelog]](CHANGELOG.md)
[![Software License][ico-license]](LICENSE) [![Software License][ico-license]](LICENSE)
@@ -260,8 +261,10 @@ To run tests execute `go test ./...`. If your Go version is older than 1.9, then
[ico-lang]: https://img.shields.io/badge/lang-go%201.12-blue.svg?style=flat-square [ico-lang]: https://img.shields.io/badge/lang-go%201.12-blue.svg?style=flat-square
[ico-build]: https://img.shields.io/travis/elyby/chrly.svg?style=flat-square [ico-build]: https://img.shields.io/travis/elyby/chrly.svg?style=flat-square
[ico-coverage]: https://img.shields.io/codecov/c/github/elyby/chrly.svg?style=flat-square
[ico-changelog]: https://img.shields.io/badge/keep%20a-changelog-orange.svg?style=flat-square [ico-changelog]: https://img.shields.io/badge/keep%20a-changelog-orange.svg?style=flat-square
[ico-license]: https://img.shields.io/github/license/elyby/chrly.svg?style=flat-square [ico-license]: https://img.shields.io/github/license/elyby/chrly.svg?style=flat-square
[link-go]: https://golang.org [link-go]: https://golang.org
[link-build]: https://travis-ci.org/elyby/chrly [link-build]: https://travis-ci.org/elyby/chrly
[link-coverage]: https://codecov.io/gh/elyby/chrly

View File

@@ -25,9 +25,11 @@ type inMemoryTexturesStorage struct {
} }
func CreateInMemoryTexturesStorage() *inMemoryTexturesStorage { func CreateInMemoryTexturesStorage() *inMemoryTexturesStorage {
return &inMemoryTexturesStorage{ storage := &inMemoryTexturesStorage{
data: make(map[string]*inMemoryItem), data: make(map[string]*inMemoryItem),
} }
return storage
} }
func (s *inMemoryTexturesStorage) Start() { func (s *inMemoryTexturesStorage) Start() {

View File

@@ -51,11 +51,13 @@ var serveCmd = &cobra.Command{
return return
} }
texturesStorage := queue.CreateInMemoryTexturesStorage()
texturesStorage.Start()
mojangTexturesQueue := &queue.JobsQueue{ mojangTexturesQueue := &queue.JobsQueue{
Logger: logger, Logger: logger,
Storage: &queue.SplittedStorage{ Storage: &queue.SplittedStorage{
UuidsStorage: mojangUuidsRepository, UuidsStorage: mojangUuidsRepository,
TexturesStorage: queue.CreateInMemoryTexturesStorage(), TexturesStorage: texturesStorage,
}, },
} }
logger.Info("Mojang's textures queue is successfully initialized") logger.Info("Mojang's textures queue is successfully initialized")