mirror of
https://github.com/Yonle/bostr.git
synced 2025-03-18 05:42:03 +01:00
Document environment variables and allow in-memory mode for temp datas
Signed-off-by: Yonle <yonle@lecturify.net>
This commit is contained in:
parent
a05c81c936
commit
db838be289
@ -36,6 +36,10 @@ Or run in background with `tmux`:
|
||||
tmux new -d "node index.js"
|
||||
```
|
||||
|
||||
## Environment Variable
|
||||
- `CLUSTERS` - Run Bostr with specified numbers of clusters.
|
||||
- `IN_MEMORY` - Store temporary data in memory (RAM) instead of disk.
|
||||
|
||||
## License
|
||||
|
||||
Copyright 2023 Yonle <yonle@lecturify.net>
|
||||
|
@ -2,7 +2,7 @@ const SQLite = require("better-sqlite3");
|
||||
const WebSocket = require("ws");
|
||||
const { relays } = require("./config");
|
||||
const socks = new Set();
|
||||
const sess = new SQLite(".temporary.db");
|
||||
const sess = new SQLite(process.env.IN_MEMORY ? null : (__dirname + "/6.temporary.db"));
|
||||
const csess = new Map();
|
||||
|
||||
// Handle database....
|
||||
@ -119,6 +119,7 @@ function newConn(addr) {
|
||||
break;
|
||||
}
|
||||
case "NOTICE":
|
||||
console.log(process.pid, relay.addr, "NOTICE", data[1]);
|
||||
bc_c(data);
|
||||
break;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user