mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-07-10 22:32:16 +02:00
chore: linting
This commit is contained in:
parent
0a012dbc79
commit
ce952d2ad1
127 changed files with 821 additions and 517 deletions
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
from __future__ import annotations
|
||||
|
||||
import contextlib
|
||||
from collections.abc import AsyncIterator
|
||||
|
||||
from app.file_storage.backends.base import StorageBackend
|
||||
|
|
@ -43,10 +44,8 @@ class AzureBlobBackend(StorageBackend):
|
|||
|
||||
async with self._service() as service:
|
||||
blob = service.get_blob_client(self._container, key)
|
||||
try:
|
||||
with contextlib.suppress(ResourceNotFoundError):
|
||||
await blob.delete_blob()
|
||||
except ResourceNotFoundError:
|
||||
pass
|
||||
|
||||
async def exists(self, key: str) -> bool:
|
||||
async with self._service() as service:
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
from __future__ import annotations
|
||||
|
||||
import asyncio
|
||||
import contextlib
|
||||
from collections.abc import AsyncIterator
|
||||
from pathlib import Path
|
||||
|
||||
|
|
@ -53,10 +54,8 @@ class LocalFileBackend(StorageBackend):
|
|||
path = self._path_for(key)
|
||||
|
||||
def _unlink() -> None:
|
||||
try:
|
||||
with contextlib.suppress(FileNotFoundError):
|
||||
path.unlink()
|
||||
except FileNotFoundError:
|
||||
pass
|
||||
|
||||
await asyncio.to_thread(_unlink)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue