File tree 2 files changed +8
-6
lines changed
2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change 17
17
[ #2364 ] ( https://github.com/juanfont/headscale/pull/2364 )
18
18
- Remove invalid routes and add stronger constraints for routes to avoid API panic
19
19
[ #2371 ] ( https://github.com/juanfont/headscale/pull/2371 )
20
+ - Fix panic when ` derp.update_frequency ` is 0
21
+ [ #2368 ] ( https://github.com/juanfont/headscale/pull/2368 )
20
22
21
23
## 0.24.0 (2025-01-17)
22
24
Original file line number Diff line number Diff line change @@ -245,11 +245,11 @@ func (h *Headscale) scheduledTasks(ctx context.Context) {
245
245
246
246
lastExpiryCheck := time .Unix (0 , 0 )
247
247
248
- derpTicker := time .NewTicker ( h . cfg . DERP . UpdateFrequency )
249
- defer derpTicker . Stop ()
250
- // If we dont want auto update, just stop the ticker
251
- if ! h . cfg . DERP . AutoUpdate {
252
- derpTicker .Stop ()
248
+ derpTickerChan := make ( <- chan time.Time )
249
+ if h . cfg . DERP . AutoUpdate && h . cfg . DERP . UpdateFrequency != 0 {
250
+ derpTicker := time . NewTicker ( h . cfg . DERP . UpdateFrequency )
251
+ defer derpTicker . Stop ()
252
+ derpTickerChan = derpTicker .C
253
253
}
254
254
255
255
var extraRecordsUpdate <- chan []tailcfg.DNSRecord
@@ -285,7 +285,7 @@ func (h *Headscale) scheduledTasks(ctx context.Context) {
285
285
h .nodeNotifier .NotifyAll (ctx , update )
286
286
}
287
287
288
- case <- derpTicker . C :
288
+ case <- derpTickerChan :
289
289
log .Info ().Msg ("Fetching DERPMap updates" )
290
290
h .DERPMap = derp .GetDERPMap (h .cfg .DERP )
291
291
if h .cfg .DERP .ServerEnabled && h .cfg .DERP .AutomaticallyAddEmbeddedDerpRegion {
You can’t perform that action at this time.
0 commit comments