mirror of
https://gitlab.computer.surgery/matrix/grapevine.git
synced 2025-12-18 16:21:24 +01:00
set default database backend in nixos module to rocksdb
The media backend already has a default value.
This commit is contained in:
parent
1cd12460d7
commit
cc0bde5b4d
2 changed files with 25 additions and 37 deletions
|
|
@ -40,7 +40,15 @@ in
|
||||||
'';
|
'';
|
||||||
default = false;
|
default = false;
|
||||||
};
|
};
|
||||||
database.path = lib.mkOption {
|
database = {
|
||||||
|
backend = lib.mkOption {
|
||||||
|
type = types.nonEmptyStr;
|
||||||
|
description = ''
|
||||||
|
The database backend to use.
|
||||||
|
'';
|
||||||
|
default = "rocksdb";
|
||||||
|
};
|
||||||
|
path = lib.mkOption {
|
||||||
type = types.nonEmptyStr;
|
type = types.nonEmptyStr;
|
||||||
readOnly = true;
|
readOnly = true;
|
||||||
description = ''
|
description = ''
|
||||||
|
|
@ -53,6 +61,7 @@ in
|
||||||
then "/var/lib/matrix-conduit/database"
|
then "/var/lib/matrix-conduit/database"
|
||||||
else "/var/lib/grapevine/database";
|
else "/var/lib/grapevine/database";
|
||||||
};
|
};
|
||||||
|
};
|
||||||
media.backend = {
|
media.backend = {
|
||||||
type = lib.mkOption {
|
type = lib.mkOption {
|
||||||
type = types.nonEmptyStr;
|
type = types.nonEmptyStr;
|
||||||
|
|
|
||||||
|
|
@ -716,7 +716,10 @@ pub(crate) fn parse_incoming_pdu(
|
||||||
let room_version_id = services()
|
let room_version_id = services()
|
||||||
.rooms
|
.rooms
|
||||||
.state
|
.state
|
||||||
.get_create_content::<ExtractVersion>(&room_id)?;
|
.get_create_content::<ExtractVersion>(&room_id)
|
||||||
|
.inspect_err(|_| {
|
||||||
|
debug!(%room_id, "This server is not in the room");
|
||||||
|
})?;
|
||||||
|
|
||||||
let Ok((event_id, value)) =
|
let Ok((event_id, value)) =
|
||||||
gen_event_id_canonical_json(pdu, &room_version_id)
|
gen_event_id_canonical_json(pdu, &room_version_id)
|
||||||
|
|
@ -745,31 +748,7 @@ pub(crate) async fn send_transaction_message_route(
|
||||||
let pub_key_map = RwLock::new(BTreeMap::new());
|
let pub_key_map = RwLock::new(BTreeMap::new());
|
||||||
|
|
||||||
for pdu in &body.pdus {
|
for pdu in &body.pdus {
|
||||||
let value: CanonicalJsonObject = serde_json::from_str(pdu.get())
|
let (event_id, value, room_id) = match parse_incoming_pdu(pdu) {
|
||||||
.map_err(|error| {
|
|
||||||
warn!(%error, object = ?pdu, "Error parsing incoming event");
|
|
||||||
Error::BadServerResponse("Invalid PDU in server response")
|
|
||||||
})?;
|
|
||||||
let room_id: OwnedRoomId = value
|
|
||||||
.get("room_id")
|
|
||||||
.and_then(|id| RoomId::parse(id.as_str()?).ok())
|
|
||||||
.ok_or(Error::BadRequest(
|
|
||||||
ErrorKind::InvalidParam,
|
|
||||||
"Invalid room id in pdu",
|
|
||||||
))?;
|
|
||||||
|
|
||||||
if services()
|
|
||||||
.rooms
|
|
||||||
.state
|
|
||||||
.get_create_content::<ExtractVersion>(&room_id)
|
|
||||||
.is_err()
|
|
||||||
{
|
|
||||||
debug!(%room_id, "This server is not in the room");
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
let r = parse_incoming_pdu(pdu);
|
|
||||||
let (event_id, value, room_id) = match r {
|
|
||||||
Ok(t) => t,
|
Ok(t) => t,
|
||||||
Err(error) => {
|
Err(error) => {
|
||||||
warn!(%error, object = ?pdu, "Error parsing incoming event");
|
warn!(%error, object = ?pdu, "Error parsing incoming event");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue