Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cla-backend-go/company/repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -1341,7 +1341,7 @@ func (repo repository) ClearCompanySanctionStatusIfSSS(ctx context.Context, comp
Key: map[string]*dynamodb.AttributeValue{
"company_id": {S: aws.String(companyID)},
},
UpdateExpression: aws.String("SET #S = :false, #M = :m REMOVE #O"),
UpdateExpression: aws.String("SET #S = :false, #M = :m REMOVE #O"),
ConditionExpression: aws.String("#O = :sss"),
ExpressionAttributeNames: map[string]*string{
"#S": aws.String("is_sanctioned"),
Expand Down
3 changes: 2 additions & 1 deletion cla-backend-go/v2/sign/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ type service struct {
sssClient *sss.Client
sssRequired bool
complianceCache map[string]complianceCacheEntry
complianceCacheMu sync.Mutex
complianceCacheMu *sync.Mutex
}

type complianceCacheEntry struct {
Expand Down Expand Up @@ -162,6 +162,7 @@ func NewService(apiURL, v1API string, compRepo company.IRepository, projectRepo
sssClient: sssClient,
sssRequired: sssRequired,
complianceCache: make(map[string]complianceCacheEntry),
complianceCacheMu: &sync.Mutex{},
}
}

Expand Down
4 changes: 3 additions & 1 deletion cla-backend-go/v2/sign/service_sss_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ package sign

import (
"context"
"sync"
"testing"
"time"

Expand Down Expand Up @@ -120,6 +121,7 @@ func TestComplianceCacheExpires(t *testing.T) {
expiresAt: time.Now().Add(-time.Second),
},
},
complianceCacheMu: &sync.Mutex{},
}

if _, ok := svc.getComplianceCache("company-id"); ok {
Expand All @@ -128,7 +130,7 @@ func TestComplianceCacheExpires(t *testing.T) {
}

func TestComplianceCacheSkipsErrors(t *testing.T) {
svc := &service{}
svc := &service{complianceCacheMu: &sync.Mutex{}}

// setComplianceCache no longer takes an err param; just verify it stores the entry
svc.setComplianceCache("company-id", false)
Expand Down
Loading