mirror of
https://github.com/Nystik-gh/ignis.git
synced 2026-06-17 04:35:53 +00:00
add server settings api
This commit is contained in:
11
apps/ignis-server/server/routes/bootstrap.js
vendored
11
apps/ignis-server/server/routes/bootstrap.js
vendored
@@ -14,6 +14,7 @@ const {
|
||||
getVirtualPluginsForVault,
|
||||
} = require("../plugin-system/manager");
|
||||
const { getVersion } = require("../version");
|
||||
const settings = require("../settings");
|
||||
|
||||
const router = express.Router();
|
||||
|
||||
@@ -140,6 +141,11 @@ async function buildEntry(vaultId) {
|
||||
// In demo mode, hide server-side plugins from the client.
|
||||
plugins: config.demoMode ? [] : getDiscoveredPlugins(),
|
||||
virtualPlugins: getVirtualPluginsForVault(vaultId, getVersion()),
|
||||
settings: {
|
||||
contentCacheBytes: settings.get("contentCacheBytes"),
|
||||
inputCacheBytes: settings.get("inputCacheBytes"),
|
||||
inputCacheTtlMs: settings.get("inputCacheTtlMs"),
|
||||
},
|
||||
};
|
||||
|
||||
const jsonBuf = Buffer.from(JSON.stringify(response));
|
||||
@@ -185,6 +191,10 @@ function invalidateVault(vaultId) {
|
||||
cache.delete(vaultId);
|
||||
}
|
||||
|
||||
function invalidateAll() {
|
||||
cache.clear();
|
||||
}
|
||||
|
||||
async function warmUp() {
|
||||
const ids = Object.keys(config.vaults);
|
||||
|
||||
@@ -251,4 +261,5 @@ router.get("/", async (req, res) => {
|
||||
|
||||
module.exports = router;
|
||||
module.exports.invalidateVault = invalidateVault;
|
||||
module.exports.invalidateAll = invalidateAll;
|
||||
module.exports.warmUp = warmUp;
|
||||
|
||||
Reference in New Issue
Block a user