mirror of
https://gitlab.computer.surgery/matrix/grapevine.git
synced 2025-12-18 08:11: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,18 +40,27 @@ in
|
|||
'';
|
||||
default = false;
|
||||
};
|
||||
database.path = lib.mkOption {
|
||||
type = types.nonEmptyStr;
|
||||
readOnly = true;
|
||||
description = ''
|
||||
The path to store database files in.
|
||||
database = {
|
||||
backend = lib.mkOption {
|
||||
type = types.nonEmptyStr;
|
||||
description = ''
|
||||
The database backend to use.
|
||||
'';
|
||||
default = "rocksdb";
|
||||
};
|
||||
path = lib.mkOption {
|
||||
type = types.nonEmptyStr;
|
||||
readOnly = true;
|
||||
description = ''
|
||||
The path to store database files in.
|
||||
|
||||
Note that this is read-only because this module makes use of
|
||||
systemd's `StateDirectory` option.
|
||||
'';
|
||||
default = if cfg.settings.conduit_compat
|
||||
then "/var/lib/matrix-conduit/database"
|
||||
else "/var/lib/grapevine/database";
|
||||
Note that this is read-only because this module makes use of
|
||||
systemd's `StateDirectory` option.
|
||||
'';
|
||||
default = if cfg.settings.conduit_compat
|
||||
then "/var/lib/matrix-conduit/database"
|
||||
else "/var/lib/grapevine/database";
|
||||
};
|
||||
};
|
||||
media.backend = {
|
||||
type = lib.mkOption {
|
||||
|
|
|
|||
|
|
@ -716,7 +716,10 @@ pub(crate) fn parse_incoming_pdu(
|
|||
let room_version_id = services()
|
||||
.rooms
|
||||
.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)) =
|
||||
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());
|
||||
|
||||
for pdu in &body.pdus {
|
||||
let value: CanonicalJsonObject = serde_json::from_str(pdu.get())
|
||||
.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 {
|
||||
let (event_id, value, room_id) = match parse_incoming_pdu(pdu) {
|
||||
Ok(t) => t,
|
||||
Err(error) => {
|
||||
warn!(%error, object = ?pdu, "Error parsing incoming event");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue