mirror of
https://github.com/BluemediaGER/muse.git
synced 2024-11-10 03:55:29 +01:00
Add script to clear key value cache
This commit is contained in:
parent
892c06a110
commit
c3231defb8
|
@ -25,6 +25,7 @@
|
||||||
"build:watch": "tsc --watch",
|
"build:watch": "tsc --watch",
|
||||||
"prepack": "npm run clean && npm run build",
|
"prepack": "npm run clean && npm run build",
|
||||||
"start": "npm run env:set-database-url -- node --experimental-json-modules dist/src/scripts/migrate-and-start.js",
|
"start": "npm run env:set-database-url -- node --experimental-json-modules dist/src/scripts/migrate-and-start.js",
|
||||||
|
"cache:clear-key-value": "npm run env:set-database-url node dist/src/scripts/cache-clear-key-value.js",
|
||||||
"dev": "concurrently nodemon 'tsc --watch'",
|
"dev": "concurrently nodemon 'tsc --watch'",
|
||||||
"migrations:generate": "npm run prisma:with-env migrate dev",
|
"migrations:generate": "npm run prisma:with-env migrate dev",
|
||||||
"migrations:run": "npm run prisma:with-env migrate deploy",
|
"migrations:run": "npm run prisma:with-env migrate deploy",
|
||||||
|
|
10
src/scripts/cache-clear-key-value.ts
Normal file
10
src/scripts/cache-clear-key-value.ts
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
import ora from 'ora';
|
||||||
|
import {prisma} from '../utils/db.js';
|
||||||
|
|
||||||
|
(async () => {
|
||||||
|
const spinner = ora('Clearing key value cache...').start();
|
||||||
|
|
||||||
|
await prisma.keyValueCache.deleteMany({});
|
||||||
|
|
||||||
|
spinner.succeed('Key value cache cleared.');
|
||||||
|
})();
|
Loading…
Reference in a new issue