mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-04-02 05:23:14 +00:00
overhaul context
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
use clap::Arg;
|
||||
use embassy::context::{CliContext, EitherContext};
|
||||
use embassy::context::CliContext;
|
||||
use embassy::Error;
|
||||
use rpc_toolkit::run_cli;
|
||||
use rpc_toolkit::yajrc::RpcError;
|
||||
@@ -35,6 +35,7 @@ fn inner_main() -> Result<(), Error> {
|
||||
});
|
||||
EitherContext::Cli(CliContext::init(matches)?)
|
||||
},
|
||||
(),
|
||||
|e: RpcError| {
|
||||
match e.data {
|
||||
Some(Value::String(s)) => eprintln!("{}: {}", e.message, s),
|
||||
|
||||
@@ -2,7 +2,7 @@ use std::path::Path;
|
||||
use std::time::Duration;
|
||||
|
||||
use anyhow::anyhow;
|
||||
use embassy::context::{EitherContext, RpcContext};
|
||||
use embassy::context::RpcContext;
|
||||
use embassy::db::model::Database;
|
||||
use embassy::db::subscribe;
|
||||
use embassy::hostname::{get_hostname, get_id};
|
||||
@@ -46,7 +46,7 @@ async fn inner_main(cfg_path: Option<&str>) -> Result<(), Error> {
|
||||
.await?;
|
||||
}
|
||||
let auth = auth(rpc_ctx.clone());
|
||||
let ctx = EitherContext::Rpc(rpc_ctx.clone());
|
||||
let ctx = rpc_ctx.clone();
|
||||
let server = rpc_server!({
|
||||
command: embassy::main_api,
|
||||
context: ctx,
|
||||
|
||||
Reference in New Issue
Block a user