Skip to content

Commit 8c489d9

Browse files
committed
populate home az cache if it's not filled
1 parent 5421f61 commit 8c489d9

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

cns/restserver/homeazmonitor.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ func (h *HomeAzMonitor) readCacheValue() cns.GetHomeAzResponse {
5454
return cachedResp.(cns.GetHomeAzResponse)
5555
}
5656

57+
// Cache miss - populate cache and try again
5758
ctx, cancel := context.WithTimeout(context.Background(), ContextTimeOut)
5859
defer cancel()
5960
h.Populate(ctx)
@@ -62,6 +63,7 @@ func (h *HomeAzMonitor) readCacheValue() cns.GetHomeAzResponse {
6263
return cachedResp.(cns.GetHomeAzResponse)
6364
}
6465

66+
// Still no cache value after populate attempt
6567
return cns.GetHomeAzResponse{
6668
Response: cns.Response{
6769
ReturnCode: types.NotFound,

0 commit comments

Comments
 (0)