异步优化写入备份

This commit is contained in:
2024-11-12 20:30:19 +08:00
parent 8626664653
commit f33d61e315
21 changed files with 379 additions and 69 deletions

View File

@@ -1,3 +1,4 @@
import asyncio
from core.objects.blob_object import BlobObject
import hashlib
import tempfile
@@ -11,7 +12,8 @@ class Test_Blob:
newBlob.object_id
== hashlib.sha1(open("README.md", "rb").read()).hexdigest()
)
def test_writeBlob(self):
newBlob = BlobObject("README.md")
with tempfile.TemporaryDirectory() as tmpdirname:
newBlob.writeBlob(tmpdirname)
asyncio.run(newBlob.writeBlob(tmpdirname))