mirror of
https://git.joinplu.me/Plume/Plume.git
synced 2024-11-22 19:41:03 +00:00
Define Instance::get_locals()
This commit is contained in:
parent
037d670fb7
commit
1ed60537cf
1 changed files with 7 additions and 0 deletions
|
@ -79,6 +79,13 @@ impl Instance {
|
|||
*LOCAL_INSTANCE.write().unwrap() = Instance::get_local_uncached(conn).ok();
|
||||
}
|
||||
|
||||
pub fn get_locals(conn: &Connection) -> Result<Vec<Instance>> {
|
||||
instances::table
|
||||
.filter(instances::local.eq(true))
|
||||
.load::<Instance>(conn)
|
||||
.map_err(Error::from)
|
||||
}
|
||||
|
||||
pub fn get_remotes(conn: &Connection) -> Result<Vec<Instance>> {
|
||||
instances::table
|
||||
.filter(instances::local.eq(false))
|
||||
|
|
Loading…
Reference in a new issue