mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-09-07 09:05:55 +00:00
Fix deadlock
This commit is contained in:
parent
c042c77499
commit
b2ebb4ce06
1 changed files with 4 additions and 3 deletions
7
api.go
7
api.go
|
|
@ -140,9 +140,9 @@ func (api *API) Query(ctx context.Context, req *QueryRequest) (QueryResponse, er
|
|||
}
|
||||
|
||||
// Translate column attributes, if necessary.
|
||||
if api.server.translateFile != nil {
|
||||
if api.server.primaryTranslateStore != nil {
|
||||
for _, col := range resp.ColumnAttrSets {
|
||||
v, err := api.server.translateFile.TranslateColumnToString(req.Index, col.ID)
|
||||
v, err := api.server.primaryTranslateStore.TranslateColumnToString(req.Index, col.ID)
|
||||
if err != nil {
|
||||
return resp, err
|
||||
}
|
||||
|
|
@ -788,7 +788,7 @@ func (api *API) ResizeAbort() error {
|
|||
// TranslateStoreBufferSize is the buffer size used for streaming data.
|
||||
const TranslateStoreBufferSize = 65536
|
||||
|
||||
func (api *API) GetTranslateData(ctx context.Context, w io.Writer, offset int64) error {
|
||||
func (api *API) GetTranslateData(ctx context.Context, w io.WriteCloser, offset int64) error {
|
||||
rc, err := api.server.primaryTranslateStore.Reader(ctx, offset)
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "read from translate store")
|
||||
|
|
@ -799,6 +799,7 @@ func (api *API) GetTranslateData(ctx context.Context, w io.Writer, offset int64)
|
|||
|
||||
go func() {
|
||||
defer rc.Close()
|
||||
defer w.Close()
|
||||
|
||||
buf := make([]byte, TranslateStoreBufferSize)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue