mirror of
https://github.com/Kpa-clawbot/meshcore-analyzer.git
synced 2026-08-28 09:25:16 +00:00
Disable auto-seeding on empty DB - require --seed flag or SEED_DB=true
Previously db.seed() ran unconditionally on startup and would populate a fresh database with fake test data. Now seeding only triggers when explicitly requested via --seed CLI flag or SEED_DB=true env var. The seed functionality remains available for developers: node server.js --seed SEED_DB=true node server.js node db.js (direct run still seeds)
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "meshcore-analyzer",
|
||||
"version": "2.1.0",
|
||||
"version": "2.1.1",
|
||||
"description": "Community-run alternative to the closed-source `analyzer.letsmesh.net`. MQTT packet collection + open-source web analyzer for the Bay Area MeshCore mesh.",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
|
||||
@@ -259,8 +259,10 @@ class TTLCache {
|
||||
const cache = new TTLCache();
|
||||
|
||||
|
||||
// Seed DB if empty
|
||||
db.seed();
|
||||
// Seed DB only when explicitly requested via --seed flag or SEED_DB=true env var
|
||||
if (process.argv.includes('--seed') || process.env.SEED_DB === 'true') {
|
||||
db.seed();
|
||||
}
|
||||
|
||||
const app = express();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user