Skip to content

Commit 27a8eb1

Browse files
committed
feat: added CLI param to aw-server for skipping legacy import
1 parent 90aa6a5 commit 27a8eb1

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

aw-server/src/main.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ fn main() {
3232
opts.optopt("", "port", "port to listent to", "PORT");
3333
opts.optopt("", "dbpath", "path to database", "PATH");
3434

35+
opts.optflag("", "no-legacy-import", "don't import from aw-server-python");
36+
3537
let matches = match opts.parse(&args[1..]) {
3638
Ok(m) => m,
3739
Err(f) => panic!("{}", f.to_string()),
@@ -76,10 +78,12 @@ fn main() {
7678
let asset_path = get_asset_path();
7779
info!("Using aw-webui assets at path {:?}", asset_path);
7880

81+
let legacy_import = !matches.opt_present("no-legacy-import");
82+
7983
let server_state = endpoints::ServerState {
8084
// Even if legacy_import is set to true it is disabled on Android so
8185
// it will not happen there
82-
datastore: Mutex::new(aw_datastore::Datastore::new(db_path, true)),
86+
datastore: Mutex::new(aw_datastore::Datastore::new(db_path, legacy_import)),
8387
asset_path,
8488
device_id: device_id::get_device_id(),
8589
};

0 commit comments

Comments
 (0)