Updated cfpurge.js and thumbs.js

Sigh.
This commit is contained in:
Bobby Wibowo 2019-01-31 16:49:14 +07:00
parent 1c23a8a6eb
commit aab62b6bfe
No known key found for this signature in database
GPG Key ID: 51C3A1E1E22D26CF
2 changed files with 5 additions and 2 deletions

View File

@ -16,7 +16,7 @@ cfpurge.do = async () => {
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)
if (result.errors.length)
result.errors.forEach(error => console.error(`CF: ${error}`))

View File

@ -99,7 +99,10 @@ thumbs.do = async () => {
if (thumbs.cfcache && succeeded.length) {
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++) {
if (results[i].errors.length)
results[i].errors.forEach(error => console.error(`CF: ${error}`))