nucliadb 6.3.3.post3621__py3-none-any.whl → 6.3.3.post3626__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -21,6 +21,7 @@ import asyncio
21
21
  import importlib.metadata
22
22
  from typing import AsyncGenerator
23
23
 
24
+ from nucliadb.common import datamanagers
24
25
  from nucliadb.common.cluster.exceptions import NodeError, ShardNotFound
25
26
  from nucliadb.common.cluster.utils import setup_cluster, teardown_cluster
26
27
  from nucliadb.common.maindb.driver import Driver
@@ -185,7 +186,11 @@ async def _purge_resources_storage_batch(driver: Driver, storage: Storage, batch
185
186
  tasks = []
186
187
  for key in to_delete_batch:
187
188
  kbid, resource_id = key.split("/")[-2:]
188
- tasks.append(asyncio.create_task(storage.delete_resource(kbid, resource_id)))
189
+ # Check if resource exists in maindb. This can happen if a file is deleted (marked for purge) and immediately
190
+ # reuploaded. Without this check, we will delete the data of the newly uploaded copy of the resource.
191
+ if not await datamanagers.atomic.resources.resource_exists(kbid=kbid, rid=resource_id):
192
+ tasks.append(asyncio.create_task(storage.delete_resource(kbid, resource_id)))
193
+
189
194
  await asyncio.gather(*tasks)
190
195
 
191
196
  # Delete the schedule-to-delete keys
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: nucliadb
3
- Version: 6.3.3.post3621
3
+ Version: 6.3.3.post3626
4
4
  Summary: NucliaDB
5
5
  Author-email: Nuclia <nucliadb@nuclia.com>
6
6
  License: AGPL
@@ -20,11 +20,11 @@ Classifier: Programming Language :: Python :: 3.12
20
20
  Classifier: Programming Language :: Python :: 3 :: Only
21
21
  Requires-Python: <4,>=3.9
22
22
  Description-Content-Type: text/markdown
23
- Requires-Dist: nucliadb-telemetry[all]>=6.3.3.post3621
24
- Requires-Dist: nucliadb-utils[cache,fastapi,storages]>=6.3.3.post3621
25
- Requires-Dist: nucliadb-protos>=6.3.3.post3621
26
- Requires-Dist: nucliadb-models>=6.3.3.post3621
27
- Requires-Dist: nidx-protos>=6.3.3.post3621
23
+ Requires-Dist: nucliadb-telemetry[all]>=6.3.3.post3626
24
+ Requires-Dist: nucliadb-utils[cache,fastapi,storages]>=6.3.3.post3626
25
+ Requires-Dist: nucliadb-protos>=6.3.3.post3626
26
+ Requires-Dist: nucliadb-models>=6.3.3.post3626
27
+ Requires-Dist: nidx-protos>=6.3.3.post3626
28
28
  Requires-Dist: nucliadb-admin-assets>=1.0.0.post1224
29
29
  Requires-Dist: nuclia-models>=0.24.2
30
30
  Requires-Dist: uvicorn
@@ -165,7 +165,7 @@ nucliadb/migrator/settings.py,sha256=jOUX0ZMunCXN8HpF9xXN0aunJYRhu4Vdr_ffjRIqwtw
165
165
  nucliadb/migrator/utils.py,sha256=NgUreUvON8_nWEzTxELBMWlfV7E6-6qi-g0DMEbVEz4,2885
166
166
  nucliadb/models/__init__.py,sha256=cp15ZcFnHvpcu_5-aK2A4uUyvuZVV_MJn4bIXMa20ks,835
167
167
  nucliadb/models/responses.py,sha256=qnuOoc7TrVSUnpikfTwHLKez47_DE4mSFzpxrwtqijA,1599
168
- nucliadb/purge/__init__.py,sha256=p-DxJ3vGtEcCuiSsWY22bQn99vTMHk32BQdQJVy5b0k,11983
168
+ nucliadb/purge/__init__.py,sha256=UXbto56EWYLwZj6uEc-flQVe3gDDNFtM6EV-aIkryPU,12353
169
169
  nucliadb/purge/orphan_shards.py,sha256=AU1Jfc4qtQFasB6dkuGz0a_Zjs-i7liUTf7Xpl8R8ng,7939
170
170
  nucliadb/reader/__init__.py,sha256=C5Efic7WlGm2U2C5WOyquMFbIj2Pojwe_8mwzVYnOzE,1304
171
171
  nucliadb/reader/app.py,sha256=Se-BFTE6d1v1msLzQn4q5XIhjnSxa2ckDSHdvm7NRf8,3096
@@ -351,8 +351,8 @@ nucliadb/writer/tus/local.py,sha256=7jYa_w9b-N90jWgN2sQKkNcomqn6JMVBOVeDOVYJHto,
351
351
  nucliadb/writer/tus/s3.py,sha256=vF0NkFTXiXhXq3bCVXXVV-ED38ECVoUeeYViP8uMqcU,8357
352
352
  nucliadb/writer/tus/storage.py,sha256=ToqwjoYnjI4oIcwzkhha_MPxi-k4Jk3Lt55zRwaC1SM,2903
353
353
  nucliadb/writer/tus/utils.py,sha256=MSdVbRsRSZVdkaum69_0wku7X3p5wlZf4nr6E0GMKbw,2556
354
- nucliadb-6.3.3.post3621.dist-info/METADATA,sha256=SQabE3xZSXmHoDasDSvXFiDaUJqMkmdkjf5dj6_jWic,4291
355
- nucliadb-6.3.3.post3621.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
356
- nucliadb-6.3.3.post3621.dist-info/entry_points.txt,sha256=XqGfgFDuY3zXQc8ewXM2TRVjTModIq851zOsgrmaXx4,1268
357
- nucliadb-6.3.3.post3621.dist-info/top_level.txt,sha256=hwYhTVnX7jkQ9gJCkVrbqEG1M4lT2F_iPQND1fCzF80,20
358
- nucliadb-6.3.3.post3621.dist-info/RECORD,,
354
+ nucliadb-6.3.3.post3626.dist-info/METADATA,sha256=IoTcS-I-HSFWU6Be7gUPbWE3I60TUvgAfOP3jRQ-LUs,4291
355
+ nucliadb-6.3.3.post3626.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
356
+ nucliadb-6.3.3.post3626.dist-info/entry_points.txt,sha256=XqGfgFDuY3zXQc8ewXM2TRVjTModIq851zOsgrmaXx4,1268
357
+ nucliadb-6.3.3.post3626.dist-info/top_level.txt,sha256=hwYhTVnX7jkQ9gJCkVrbqEG1M4lT2F_iPQND1fCzF80,20
358
+ nucliadb-6.3.3.post3626.dist-info/RECORD,,