Add lock to sql connection as well

This commit is contained in:
Jeff Mitchell 2017-12-19 10:38:26 -05:00
parent 28e8fd1ca7
commit 7ef59df0b2

View File

@ -76,6 +76,9 @@ func (c *SQLConnectionProducer) Initialize(ctx context.Context, conf map[string]
}
func (c *SQLConnectionProducer) Connection(ctx context.Context) (interface{}, error) {
c.Lock()
defer c.Unlock()
if !c.Initialized {
return nil, ErrNotInitialized
}