diff --git a/bin/check_swagger b/bin/check_swagger index f0dce95d7f..0b67e2b5dd 100755 --- a/bin/check_swagger +++ b/bin/check_swagger @@ -7,6 +7,7 @@ source bin/helpers/output.sh bin/swagger_generate if [ $? -ne 0 ]; then print_error "Swagger generation failed" + exit 1 fi # validate diff --git a/session/create_consumer.go b/session/create_consumer.go index 67e89ac663..8ba970ee56 100644 --- a/session/create_consumer.go +++ b/session/create_consumer.go @@ -76,7 +76,7 @@ func (consumer *createConsumer) Consume(requestPtr interface{}) (response interf case nil: if destroyCallback != nil { go func() { - <-sessionInstance.Done + <-sessionInstance.done destroyCallback() }() } diff --git a/session/dto.go b/session/dto.go index 55bb4c6ec7..90d884eb82 100644 --- a/session/dto.go +++ b/session/dto.go @@ -36,10 +36,10 @@ type BalanceTracker interface { type Session struct { ID ID ConsumerID identity.Identity - Done chan struct{} Config ServiceConfiguration CreatedAt time.Time Last bool + done chan struct{} } // ServiceConfiguration defines service configuration from underlying transport mechanism to be passed to remote party diff --git a/session/manager.go b/session/manager.go index 4c5f9209e0..c007663f55 100644 --- a/session/manager.go +++ b/session/manager.go @@ -129,7 +129,7 @@ func (manager *Manager) Create(consumerID identity.Identity, issuerID identity.I return } sessionInstance.ConsumerID = consumerID - sessionInstance.Done = make(chan struct{}) + sessionInstance.done = make(chan struct{}) sessionInstance.Config = config sessionInstance.CreatedAt = time.Now().UTC() @@ -140,7 +140,7 @@ func (manager *Manager) Create(consumerID identity.Identity, issuerID identity.I // stop the balance tracker once the session is finished go func() { - <-sessionInstance.Done + <-sessionInstance.done balanceTracker.Stop() }() @@ -193,7 +193,7 @@ func (manager *Manager) Destroy(consumerID identity.Identity, sessionID string) } manager.sessionStorage.Remove(ID(sessionID)) - close(sessionInstance.Done) + close(sessionInstance.done) return nil } diff --git a/session/manager_test.go b/session/manager_test.go index 068af2e160..37de914466 100644 --- a/session/manager_test.go +++ b/session/manager_test.go @@ -71,12 +71,12 @@ func TestManager_Create_StoresSession(t *testing.T) { requestConfig := json.RawMessage{} sessionInstance, err := manager.Create(consumerID, consumerID, currentProposalID, nil, requestConfig) - expectedResult.Done = sessionInstance.Done + expectedResult.done = sessionInstance.done assert.NoError(t, err) assert.Equal(t, expectedResult.Config, sessionInstance.Config) assert.Equal(t, expectedResult.Last, sessionInstance.Last) - assert.Equal(t, expectedResult.Done, sessionInstance.Done) + assert.Equal(t, expectedResult.done, sessionInstance.done) assert.Equal(t, expectedResult.ConsumerID, sessionInstance.ConsumerID) assert.Equal(t, expectedResult.ID, sessionInstance.ID) assert.False(t, sessionInstance.CreatedAt.IsZero())