forked from lavina/lavina
wip
This commit is contained in:
parent
361946bc35
commit
a740dc80fe
|
@ -20,5 +20,4 @@ addresses = []
|
|||
[cluster.metadata]
|
||||
node_id = 0
|
||||
main_owner = 0
|
||||
test_owner = 0
|
||||
test2_owner = 0
|
||||
rooms = {}
|
||||
|
|
|
@ -124,8 +124,7 @@ impl TestServer {
|
|||
metadata: ClusterMetadata {
|
||||
node_id: 0,
|
||||
main_owner: 0,
|
||||
test_owner: 0,
|
||||
test2_owner: 0,
|
||||
rooms: Default::default(),
|
||||
},
|
||||
};
|
||||
let core = LavinaCore::new(metrics.clone(), cluster_config, storage.clone()).await?;
|
||||
|
@ -148,8 +147,7 @@ impl TestServer {
|
|||
metadata: ClusterMetadata {
|
||||
node_id: 0,
|
||||
main_owner: 0,
|
||||
test_owner: 0,
|
||||
test2_owner: 0,
|
||||
rooms: Default::default(),
|
||||
},
|
||||
};
|
||||
let TestServer {
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
use prometheus::Registry as MetricsRegistry;
|
||||
|
||||
use crate::{Authenticated, XmppConnection};
|
||||
use lavina_core::player::{PlayerConnection, PlayerId};
|
||||
use lavina_core::clustering::{ClusterConfig, ClusterMetadata};
|
||||
use lavina_core::player::PlayerConnection;
|
||||
use lavina_core::repo::{Storage, StorageConfig};
|
||||
use lavina_core::LavinaCore;
|
||||
use prometheus::Registry as MetricsRegistry;
|
||||
use proto_xmpp::bind::{BindRequest, BindResponse, Jid, Name, Resource, Server};
|
||||
|
||||
pub(crate) struct TestServer {
|
||||
|
@ -19,7 +21,15 @@ impl TestServer {
|
|||
db_path: ":memory:".into(),
|
||||
})
|
||||
.await?;
|
||||
let core = LavinaCore::new(metrics.clone(), storage.clone()).await?;
|
||||
let cluster_config = ClusterConfig {
|
||||
metadata: ClusterMetadata {
|
||||
node_id: 0,
|
||||
main_owner: 0,
|
||||
rooms: Default::default(),
|
||||
},
|
||||
addresses: vec![],
|
||||
};
|
||||
let core = LavinaCore::new(metrics.clone(), cluster_config, storage.clone()).await?;
|
||||
Ok(TestServer { metrics, storage, core })
|
||||
}
|
||||
|
||||
|
@ -27,7 +37,15 @@ impl TestServer {
|
|||
self.core.shutdown().await?;
|
||||
|
||||
let metrics = MetricsRegistry::new();
|
||||
let core = LavinaCore::new(metrics.clone(), self.storage.clone()).await?;
|
||||
let cluster_config = ClusterConfig {
|
||||
metadata: ClusterMetadata {
|
||||
node_id: 0,
|
||||
main_owner: 0,
|
||||
rooms: Default::default(),
|
||||
},
|
||||
addresses: vec![],
|
||||
};
|
||||
let core = LavinaCore::new(metrics.clone(), cluster_config, self.storage.clone()).await?;
|
||||
|
||||
Ok(TestServer {
|
||||
metrics,
|
||||
|
|
|
@ -167,8 +167,7 @@ impl TestServer {
|
|||
metadata: ClusterMetadata {
|
||||
node_id: 0,
|
||||
main_owner: 0,
|
||||
test_owner: 0,
|
||||
test2_owner: 0,
|
||||
rooms: Default::default(),
|
||||
},
|
||||
};
|
||||
let core = LavinaCore::new(metrics.clone(), cluster_config, storage.clone()).await?;
|
||||
|
|
Loading…
Reference in New Issue