Skip to content

Commit ef382a9

Browse files
committed
fix(cdn): add only refresh cdn feature
1 parent 3174515 commit ef382a9

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/baas/cdn/index.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ class Cdn {
5050
delete inputs.oldState
5151
const {
5252
Async = false,
53+
OnlyRefresh = false,
5354
Domain,
5455
Origin,
5556
ServiceType = 'web',
@@ -139,6 +140,18 @@ class Cdn {
139140

140141
const cdnInfo = await getCdnByDomain(this.capi, Domain)
141142

143+
// only refresh cdn
144+
if (cdnInfo && OnlyRefresh === true) {
145+
// refresh cdn urls
146+
if (RefreshCdn && RefreshCdn.Urls) {
147+
await this.purgeCdnUrls(RefreshCdn.Urls)
148+
}
149+
return {
150+
domain: Domain,
151+
refreshUrls: RefreshCdn.Urls
152+
}
153+
}
154+
142155
const sourceInputs = JSON.parse(JSON.stringify(cdnInputs))
143156

144157
const createOrUpdateCdn = async () => {

0 commit comments

Comments
 (0)