This commit is contained in:
chrislu 2022-09-04 22:23:31 -07:00
commit f4abefc109
3 changed files with 5 additions and 2 deletions

View file

@ -121,7 +121,7 @@ func (store *ArangodbStore) BeginTransaction(ctx context.Context) (context.Conte
return nil, err return nil, err
} }
return context.WithValue(ctx, transactionKey, txn), nil return context.WithValue(driver.WithTransactionID(ctx, txn), transactionKey, txn), nil
} }
func (store *ArangodbStore) CommitTransaction(ctx context.Context) error { func (store *ArangodbStore) CommitTransaction(ctx context.Context) error {

View file

@ -34,6 +34,9 @@ func (store *ArangodbStore) OnBucketDeletion(bucket string) {
glog.Errorf("bucket delete %s: %v", bucket, err) glog.Errorf("bucket delete %s: %v", bucket, err)
return return
} }
store.mu.Lock()
delete(store.buckets, bucket)
store.mu.Unlock()
} }
func (store *ArangodbStore) CanDropWholeBucket() bool { func (store *ArangodbStore) CanDropWholeBucket() bool {
return true return true

View file

@ -86,7 +86,7 @@ func (store *ArangodbStore) ensureBucket(ctx context.Context, bucket string) (bc
store.mu.RLock() store.mu.RLock()
bc, ok = store.buckets[bucket] bc, ok = store.buckets[bucket]
store.mu.RUnlock() store.mu.RUnlock()
if ok { if ok && bc != nil {
return bc, nil return bc, nil
} }
store.mu.Lock() store.mu.Lock()