3
0

Fix mutexes

This commit is contained in:
Tomaž Jerman 2019-09-20 09:22:06 +02:00
parent b508ee07c9
commit 21e7aa1222
2 changed files with 4 additions and 2 deletions

View File

@ -14,7 +14,7 @@ import (
type (
service struct {
l sync.Mutex
l *sync.Mutex
logger *zap.Logger
// service will flush values on TRUE or just reload on FALSE
@ -35,6 +35,7 @@ const (
// It acts as a caching layer
func Service(ctx context.Context, logger *zap.Logger, repository *repository) (svc *service) {
svc = &service{
l: &sync.Mutex{},
f: make(chan bool),
logger: logger.Named("permissions"),

View File

@ -15,7 +15,7 @@ import (
type (
service struct {
l sync.Mutex
l *sync.Mutex
logger *zap.Logger
c AutomationServiceConfig
@ -70,6 +70,7 @@ func Service(c AutomationServiceConfig) (svc *service) {
logger: c.Logger.Named("automation"),
c: c,
l: &sync.Mutex{},
makeToken: c.TokenMaker,