mirror of
https://github.com/BobbyWibowo/lolisafe.git
synced 2025-01-31 07:11:33 +00:00
Updated cfpurge.js and thumbs.js
Sigh.
This commit is contained in:
parent
1c23a8a6eb
commit
aab62b6bfe
@ -16,7 +16,7 @@ cfpurge.do = async () => {
|
|||||||
Upload names separated by space (will automatically include their thumbs if available).
|
Upload names separated by space (will automatically include their thumbs if available).
|
||||||
`))
|
`))
|
||||||
|
|
||||||
const results = await utils.purgeCloudflareCache(args, true)
|
const results = await utils.purgeCloudflareCache(args, true, true)
|
||||||
for (const result of results)
|
for (const result of results)
|
||||||
if (result.errors.length)
|
if (result.errors.length)
|
||||||
result.errors.forEach(error => console.error(`CF: ${error}`))
|
result.errors.forEach(error => console.error(`CF: ${error}`))
|
||||||
|
@ -99,7 +99,10 @@ thumbs.do = async () => {
|
|||||||
|
|
||||||
if (thumbs.cfcache && succeeded.length) {
|
if (thumbs.cfcache && succeeded.length) {
|
||||||
console.log('Purging Cloudflare\'s cache...')
|
console.log('Purging Cloudflare\'s cache...')
|
||||||
const results = await utils.purgeCloudflareCache(succeeded.map(n => `thumbs/${n}`), true, false)
|
const results = await utils.purgeCloudflareCache(succeeded.map(name => {
|
||||||
|
const extname = utils.extname(name)
|
||||||
|
return `thumbs/${name.slice(0, -extname.length)}.png`
|
||||||
|
}), true, false)
|
||||||
for (let i = 0; i < results.length; i++) {
|
for (let i = 0; i < results.length; i++) {
|
||||||
if (results[i].errors.length)
|
if (results[i].errors.length)
|
||||||
results[i].errors.forEach(error => console.error(`CF: ${error}`))
|
results[i].errors.forEach(error => console.error(`CF: ${error}`))
|
||||||
|
Loading…
Reference in New Issue
Block a user