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:
@@ -1,5 +1,6 @@
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const { readJsonFile, writeJsonFile } = require('./jsonFileStore');
|
||||
|
||||
const STORE_WATCH_DIR = path.join(__dirname, '..', 'config');
|
||||
|
||||
@@ -41,12 +42,11 @@ function readStoreWatch(profileId) {
|
||||
ensureDir();
|
||||
const filePath = getStoreWatchPath(profileId);
|
||||
if (!fs.existsSync(filePath)) {
|
||||
fs.writeFileSync(filePath, JSON.stringify([], null, 2));
|
||||
writeJsonFile(filePath, [], { backup: false });
|
||||
return [];
|
||||
}
|
||||
try {
|
||||
const raw = fs.readFileSync(filePath, 'utf8');
|
||||
const parsed = JSON.parse(raw);
|
||||
const parsed = readJsonFile(filePath, [], Array.isArray);
|
||||
if (!Array.isArray(parsed)) {
|
||||
return [];
|
||||
}
|
||||
@@ -76,7 +76,7 @@ function writeStoreWatch(profileId, entries = []) {
|
||||
});
|
||||
ensureDir();
|
||||
const filePath = getStoreWatchPath(profileId);
|
||||
fs.writeFileSync(filePath, JSON.stringify(sanitized, null, 2));
|
||||
writeJsonFile(filePath, sanitized);
|
||||
return sanitized;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user