Added cache reload button to admin panel so restarts are needed less often.
This commit is contained in:
12
src/web/system.js
Normal file
12
src/web/system.js
Normal file
@@ -0,0 +1,12 @@
|
||||
import { HttpError } from '../errors.js';
|
||||
import { initCaches } from '../cache.js';
|
||||
|
||||
export async function initCachesApi(req, res) {
|
||||
if (req.user?.role !== 'admin') {
|
||||
throw new HttpError('You must be an admin to initialize caches', 404);
|
||||
}
|
||||
|
||||
await initCaches();
|
||||
|
||||
res.status(204).send();
|
||||
}
|
||||
Reference in New Issue
Block a user