mirror of
https://github.com/QuivrHQ/quivr.git
synced 2024-12-15 17:43:03 +03:00
22 lines
557 B
Python
22 lines
557 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 = 600
|
||
|
|
||
|
|
||
|
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
|
||
|
)
|
||
|
logger.info("RESPONSE SIGNED URL", response)
|
||
|
return response
|
||
|
except Exception as e:
|
||
|
logger.error(e)
|