Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
xuwx1
LightX2V
Commits
3d5b147b
Unverified
Commit
3d5b147b
authored
Oct 21, 2025
by
yihuiwen
Committed by
GitHub
Oct 21, 2025
Browse files
support cdn (#389)
Co-authored-by:
yihuiwen
<
yihuiwen@sensetime.com
>
parent
1438daae
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
lightx2v/deploy/data_manager/s3_data_manager.py
lightx2v/deploy/data_manager/s3_data_manager.py
+4
-0
No files found.
lightx2v/deploy/data_manager/s3_data_manager.py
View file @
3d5b147b
...
...
@@ -28,6 +28,7 @@ class S3DataManager(BaseDataManager):
self
.
write_timeout
=
self
.
config
.
get
(
"write_timeout"
,
10
)
self
.
addressing_style
=
self
.
config
.
get
(
"addressing_style"
,
None
)
self
.
region
=
self
.
config
.
get
(
"region"
,
None
)
self
.
cdn_url
=
self
.
config
.
get
(
"cdn_url"
,
""
)
self
.
session
=
None
self
.
s3_client
=
None
self
.
presign_client
=
None
...
...
@@ -138,6 +139,9 @@ class S3DataManager(BaseDataManager):
@
class_try_catch_async
async
def
presign_url
(
self
,
filename
,
abs_path
=
None
):
filename
=
self
.
fmt_path
(
self
.
base_path
,
filename
,
abs_path
)
if
self
.
cdn_url
:
return
f
"
{
self
.
cdn_url
}
/
{
filename
}
"
if
self
.
presign_client
:
expires
=
self
.
config
.
get
(
"presign_expires"
,
24
*
60
*
60
)
out
=
await
asyncio
.
to_thread
(
self
.
presign_client
.
pre_signed_url
,
tos
.
HttpMethodType
.
Http_Method_Get
,
self
.
bucket_name
,
filename
,
expires
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment