mirror of
https://git.joinplu.me/Plume/Plume.git
synced 2024-11-26 13:31:02 +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();
|
*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>> {
|
pub fn get_remotes(conn: &Connection) -> Result<Vec<Instance>> {
|
||||||
instances::table
|
instances::table
|
||||||
.filter(instances::local.eq(false))
|
.filter(instances::local.eq(false))
|
||||||
|
|
Loading…
Reference in a new issue