Skip to content

Commit 64501f0

Browse files
committed
Use symbol - SHA index rather than SHA index
1 parent d9c6112 commit 64501f0

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

arctic/chunkstore/chunkstore.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@ def _ensure_index(self):
3939

4040
self._collection.create_index([('symbol', pymongo.HASHED)],
4141
background=True)
42-
self._collection.create_index([('sha', pymongo.HASHED)],
43-
background=True)
4442
self._collection.create_index([('symbol', pymongo.ASCENDING),
4543
('sha', pymongo.ASCENDING)],
4644
unique=True,
@@ -221,7 +219,7 @@ def write(self, symbol, item, chunk_size):
221219
doc['append_count'] = 0
222220

223221
if previous_shas:
224-
mongo_retry(self._collection.delete_many)({'sha': {'$in': list(previous_shas)}})
222+
mongo_retry(self._collection.delete_many)({'symbol': symbol, 'sha': {'$in': list(previous_shas)}})
225223

226224
mongo_retry(self._symbols.update_one)({'symbol': symbol},
227225
{'$set': doc},

0 commit comments

Comments
 (0)