Add tests for connect/disconnect

This commit is contained in:
asonix
2021-02-10 09:47:23 -06:00
parent 83d05f086a
commit 52408d8189
2 changed files with 36 additions and 2 deletions
-2
View File
@@ -57,13 +57,11 @@ impl ActorCache {
}
pub(crate) async fn add_connection(&self, actor: Actor) -> Result<(), MyError> {
log::debug!("Adding connection: {}", actor.id);
self.db.add_connection(actor.id.clone()).await?;
self.db.save_actor(actor).await
}
pub(crate) async fn remove_connection(&self, actor: &Actor) -> Result<(), MyError> {
log::debug!("Removing connection: {}", actor.id);
self.db.remove_connection(actor.id.clone()).await
}