Keep track of when manifest was last cached
Can use this later to make sure we re-run them on a regular interval or something!
This commit is contained in:
parent
46066807ad
commit
cfbb23d9ff
1 changed files with 5 additions and 2 deletions
|
@ -53,14 +53,17 @@ async function cacheAssetManifests(db) {
|
||||||
// Hacky for sure!
|
// Hacky for sure!
|
||||||
const escapedManifest = JSON.stringify(JSON.stringify(manifest));
|
const escapedManifest = JSON.stringify(JSON.stringify(manifest));
|
||||||
console.log(
|
console.log(
|
||||||
`UPDATE swf_assets SET manifest = ${escapedManifest} ` +
|
`UPDATE swf_assets SET manifest = ${escapedManifest}, ` +
|
||||||
|
`manifest_cached_at = CURRENT_TIMESTAMP() ` +
|
||||||
`WHERE id = ${row.id} LIMIT 1;`
|
`WHERE id = ${row.id} LIMIT 1;`
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
const [
|
const [
|
||||||
result,
|
result,
|
||||||
] = await db.execute(
|
] = await db.execute(
|
||||||
`UPDATE swf_assets SET manifest = ? WHERE id = ? LIMIT 1;`,
|
`UPDATE swf_assets SET manifest = ?, ` +
|
||||||
|
`manifest_cached_at = CURRENT_TIMESTAMP() ` +
|
||||||
|
`WHERE id = ? LIMIT 1;`,
|
||||||
[manifest, row.id]
|
[manifest, row.id]
|
||||||
);
|
);
|
||||||
if (result.affectedRows !== 1) {
|
if (result.affectedRows !== 1) {
|
||||||
|
|
Loading…
Reference in a new issue