chore: sync running docker state
Commit the app code currently running in Docker, including scheduler, store status, journal reminder, maintenance mode, and Foodsharing API check updates. Remove generated runtime logs from version control and ignore local runtime captures.
This commit is contained in:
@@ -4,7 +4,7 @@ const { v4: uuid } = require('uuid');
|
||||
|
||||
const CONFIG_DIR = path.join(__dirname, '..', 'config');
|
||||
const LOG_FILE = path.join(CONFIG_DIR, 'request-logs.json');
|
||||
const TTL_MS = 14 * 24 * 60 * 60 * 1000;
|
||||
const TTL_MS = 28 * 24 * 60 * 60 * 1000;
|
||||
const MAX_BODY_CHARS = 10000;
|
||||
|
||||
function ensureDir() {
|
||||
@@ -79,10 +79,13 @@ function add(entry = {}) {
|
||||
return record;
|
||||
}
|
||||
|
||||
function list(limit = 500) {
|
||||
const sanitizedLimit = Math.max(1, Math.min(Number(limit) || 500, 2000));
|
||||
function list(limit) {
|
||||
const logs = prune(readLogs());
|
||||
persistLogs(logs);
|
||||
if (limit == null) {
|
||||
return logs.slice().reverse();
|
||||
}
|
||||
const sanitizedLimit = Math.max(1, Math.min(Number(limit) || 500, 10000));
|
||||
return logs.slice(-sanitizedLimit).reverse();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user