Skip to content
Snippets Groups Projects

Resolve "Data Races in Store"

Merged Ghost User requested to merge 86-data-races-in-store into develop
4 files
+ 57
26
Compare changes
  • Side-by-side
  • Inline
Files
4
+ 4
2
@@ -12,6 +12,9 @@ import (
@@ -12,6 +12,9 @@ import (
"time"
"time"
)
)
 
var coreLock sync.RWMutex
 
var coreOnce sync.Once
 
// Core is the representation of the controllers core
// Core is the representation of the controllers core
type Core struct {
type Core struct {
// deprecated
// deprecated
@@ -84,8 +87,7 @@ func createPrincipalNetworkDomain(sbi SouthboundInterface) error {
@@ -84,8 +87,7 @@ func createPrincipalNetworkDomain(sbi SouthboundInterface) error {
// Run calls initialize to start the controller
// Run calls initialize to start the controller
func Run(ctx context.Context) error {
func Run(ctx context.Context) error {
var initError error
var initError error
var once sync.Once
coreOnce.Do(func() {
once.Do(func() {
initError = initialize()
initError = initialize()
})
})
if initError != nil {
if initError != nil {
Loading