mirror of
https://github.com/scsibug/nostr-rs-relay.git
synced 2024-12-27 10:15:52 -05:00
fix: use data_dir from config.toml if present
fixes: https://todo.sr.ht/~gheartsfield/nostr-rs-relay/64
This commit is contained in:
parent
cf3e67500f
commit
585fdd3884
|
@ -24,7 +24,7 @@ description = "A newly created nostr-rs-relay.\n\nCustomize this with your own i
|
|||
# Directory for SQLite files. Defaults to the current directory. Can
|
||||
# also be specified (and overriden) with the "--db dirname" command
|
||||
# line option.
|
||||
data_directory = "."
|
||||
#data_directory = "."
|
||||
|
||||
|
||||
# Use an in-memory database instead of 'nostr.db'.
|
||||
|
|
|
@ -7,8 +7,7 @@ pub struct CLIArgs {
|
|||
short,
|
||||
long,
|
||||
help = "Use the <directory> as the location of the database",
|
||||
default_value = ".",
|
||||
required = false
|
||||
required = false,
|
||||
)]
|
||||
pub db: String,
|
||||
pub db: Option<String>,
|
||||
}
|
||||
|
|
|
@ -31,13 +31,12 @@ fn main() {
|
|||
let args = CLIArgs::parse();
|
||||
|
||||
// get database directory from args
|
||||
let db_dir = args.db;
|
||||
let db_dir_arg = args.db;
|
||||
|
||||
// update with database location
|
||||
if db_dir.len() > 0 {
|
||||
// update with database location from args, if provided
|
||||
if let Some(db_dir) = db_dir_arg {
|
||||
settings.database.data_directory = db_dir;
|
||||
}
|
||||
|
||||
let (_, ctrl_rx): (MpscSender<()>, MpscReceiver<()>) = syncmpsc::channel();
|
||||
// run this in a new thread
|
||||
let handle = thread::spawn(|| {
|
||||
|
|
Loading…
Reference in New Issue
Block a user