Skip to content

Commit c0dd332

Browse files
committed
fix concurrent report read while writing
Signed-off-by: Markus Blaschke <mblaschke82@gmail.com>
1 parent cf5d3ee commit c0dd332

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

auditor/auditor.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import (
88
"time"
99

1010
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armsubscriptions"
11-
"github.com/Azure/go-autorest/autorest"
1211
"github.com/Azure/go-autorest/autorest/to"
1312
"github.com/patrickmn/go-cache"
1413
cron "github.com/robfig/cron/v3"
@@ -376,6 +375,8 @@ func (auditor *AzureAuditor) initCron() {
376375
}
377376

378377
func (auditor *AzureAuditor) GetReport() map[string]*AzureAuditorReport {
378+
auditor.reportLock.RLock()
379+
defer auditor.reportLock.RUnlock()
379380
return auditor.report
380381
}
381382

0 commit comments

Comments
 (0)