mirror of
https://github.com/QuivrHQ/quivr.git
synced 2024-12-24 23:53:14 +03:00
4a305a854e
# Description Please include a summary of the changes and the related issue. Please also include relevant motivation and context. ## Checklist before requesting a review Please delete options that are not relevant. - [ ] My code follows the style guidelines of this project - [ ] I have performed a self-review of my code - [ ] I have commented hard-to-understand areas - [ ] I have ideally added tests that prove my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [ ] Any dependent changes have been merged ## Screenshots (if appropriate):
27 lines
677 B
Python
27 lines
677 B
Python
from multiprocessing import get_logger
|
|
|
|
from models import get_supabase_client
|
|
from supabase.client import Client
|
|
|
|
logger = get_logger()
|
|
|
|
SIGNED_URL_EXPIRATION_PERIOD_IN_SECONDS = 3600
|
|
|
|
|
|
def generate_file_signed_url(path):
|
|
supabase_client: Client = get_supabase_client()
|
|
|
|
try:
|
|
response = supabase_client.storage.from_("quivr").create_signed_url(
|
|
path,
|
|
SIGNED_URL_EXPIRATION_PERIOD_IN_SECONDS,
|
|
options={
|
|
"download": True,
|
|
"transform": None,
|
|
},
|
|
)
|
|
logger.info("RESPONSE SIGNED URL", response)
|
|
return response
|
|
except Exception as e:
|
|
logger.error(e)
|