Fix concurrent map writes for FeedIcon cache
This commit is contained in:
parent
286cbff236
commit
a8d160f9b1
2 changed files with 5 additions and 0 deletions
|
|
@ -3,6 +3,7 @@ package server
|
|||
import (
|
||||
"log"
|
||||
"net/http"
|
||||
"sync"
|
||||
|
||||
"github.com/nkanaev/yarr/src/storage"
|
||||
"github.com/nkanaev/yarr/src/worker"
|
||||
|
|
@ -13,6 +14,7 @@ type Server struct {
|
|||
db *storage.Storage
|
||||
worker *worker.Worker
|
||||
cache map[string]interface{}
|
||||
cache_mutex *sync.Mutex
|
||||
|
||||
BasePath string
|
||||
|
||||
|
|
@ -30,6 +32,7 @@ func NewServer(db *storage.Storage, addr string) *Server {
|
|||
Addr: addr,
|
||||
worker: worker.NewWorker(db),
|
||||
cache: make(map[string]interface{}),
|
||||
cache_mutex: &sync.Mutex{},
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue