mirror of
https://github.com/captbaritone/webamp.git
synced 2026-07-20 16:49:52 +00:00
Clear screenshot CDN cache after reuploading
This commit is contained in:
parent
8d5250b477
commit
f011818c12
1 changed files with 2 additions and 0 deletions
|
|
@ -5,6 +5,7 @@ import fetch from "node-fetch";
|
|||
import md5Buffer from "md5";
|
||||
import * as S3 from "../s3";
|
||||
import * as Skins from "../data/skins";
|
||||
import * as CloudFlare from "../CloudFlare";
|
||||
|
||||
const Shooter = require("../shooter");
|
||||
const temp = _temp.track();
|
||||
|
|
@ -36,6 +37,7 @@ export async function screenshot(md5: string, shooter: typeof Shooter) {
|
|||
if (success) {
|
||||
console.log("Completed screenshot");
|
||||
await S3.putScreenshot(md5, fs.readFileSync(tempScreenshotPath));
|
||||
await CloudFlare.purgeFiles([Skins.getScreenshotUrl(actualMd5)]);
|
||||
} else {
|
||||
console.log(`Screenshot failed ${md5}`);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue