mirror of
https://github.com/zitadel/zitadel.git
synced 2025-03-04 13:16:35 +00:00
fix(spooler): memory leak (#751)
* fix: dependecies * fix: one of two memory leaks found * fix: remove log
This commit is contained in:
parent
5a8cafcae5
commit
845026e43f
@ -65,6 +65,7 @@ func (s *spooledHandler) load(workerID string) {
|
|||||||
ctx, cancel := context.WithCancel(context.Background())
|
ctx, cancel := context.WithCancel(context.Background())
|
||||||
go s.awaitError(cancel, errs, workerID)
|
go s.awaitError(cancel, errs, workerID)
|
||||||
hasLocked := s.lock(ctx, errs, workerID)
|
hasLocked := s.lock(ctx, errs, workerID)
|
||||||
|
defer close(hasLocked)
|
||||||
|
|
||||||
if <-hasLocked {
|
if <-hasLocked {
|
||||||
go func() {
|
go func() {
|
||||||
@ -166,8 +167,10 @@ func (s *spooledHandler) lock(ctx context.Context, errs chan<- error, workerID s
|
|||||||
err := s.locker.Renew(workerID, s.ViewModel(), s.MinimumCycleDuration()*2)
|
err := s.locker.Renew(workerID, s.ViewModel(), s.MinimumCycleDuration()*2)
|
||||||
logging.Log("SPOOL-u4j6k").WithField("view", s.ViewModel()).WithField("worker", workerID).WithError(err).Debug("renew done")
|
logging.Log("SPOOL-u4j6k").WithField("view", s.ViewModel()).WithField("worker", workerID).WithError(err).Debug("renew done")
|
||||||
if err == nil {
|
if err == nil {
|
||||||
|
if ctx.Err() == nil {
|
||||||
locked <- true
|
locked <- true
|
||||||
renewTimer = time.After(renewDuration)
|
renewTimer = time.After(renewDuration)
|
||||||
|
}
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user