mirror of
https://github.com/pomerium/pomerium.git
synced 2025-07-17 16:48:13 +02:00
core/identity: fix slow restart
This commit is contained in:
parent
01672528cb
commit
cb4a56b54d
1 changed files with 3 additions and 2 deletions
|
@ -117,6 +117,7 @@ func (mgr *Manager) refreshLoop(ctx context.Context, update <-chan updateRecords
|
||||||
}
|
}
|
||||||
select {
|
select {
|
||||||
case <-ctx.Done():
|
case <-ctx.Done():
|
||||||
|
return ctx.Err()
|
||||||
case msg := <-update:
|
case msg := <-update:
|
||||||
mgr.onUpdateRecords(ctx, msg)
|
mgr.onUpdateRecords(ctx, msg)
|
||||||
}
|
}
|
||||||
|
@ -128,9 +129,9 @@ func (mgr *Manager) refreshLoop(ctx context.Context, update <-chan updateRecords
|
||||||
|
|
||||||
// start refreshing
|
// start refreshing
|
||||||
maxWait := time.Minute * 10
|
maxWait := time.Minute * 10
|
||||||
nextTime := time.Now().Add(maxWait)
|
var nextTime time.Time
|
||||||
|
|
||||||
timer := time.NewTimer(time.Until(nextTime))
|
timer := time.NewTimer(0)
|
||||||
defer timer.Stop()
|
defer timer.Stop()
|
||||||
|
|
||||||
for {
|
for {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue