Fix node id renewal
This commit is contained in:
@@ -13,6 +13,7 @@ If you are upgrading from v0.16.x, replace the binary (or run `docker pull`). If
|
||||
## Fixed
|
||||
- Directory: Invalidate caches when group memberships change on an external directory.
|
||||
- Log viewer: All events show as `INFO`.
|
||||
- Node id renewal.
|
||||
|
||||
## [0.16.2] - 2026-04-28
|
||||
|
||||
|
||||
@@ -458,7 +458,7 @@ impl Server {
|
||||
account: directory::Account,
|
||||
remote_ip: IpAddr,
|
||||
) -> trc::Result<AccessToken> {
|
||||
let account = self.synchronize_account(account).await?;
|
||||
let account = Box::pin(self.synchronize_account(account)).await?;
|
||||
self.access_token_from_account(account.id, account.account)
|
||||
.await
|
||||
.and_then(|token| AccessToken::new(token, remote_ip))
|
||||
|
||||
@@ -115,11 +115,11 @@ impl Server {
|
||||
};
|
||||
match directory.recipient(address.as_ref()).await? {
|
||||
Recipient::Account(account) => {
|
||||
self.synchronize_account(account).await?;
|
||||
Box::pin(self.synchronize_account(account)).await?;
|
||||
return Ok(RcptResolution::Accept);
|
||||
}
|
||||
Recipient::Group(group) => {
|
||||
self.synchronize_group(group).await?;
|
||||
Box::pin(self.synchronize_group(group)).await?;
|
||||
return Ok(RcptResolution::Accept);
|
||||
}
|
||||
Recipient::Invalid => {}
|
||||
|
||||
@@ -238,15 +238,13 @@ impl RegistryStore {
|
||||
|
||||
pub async fn refresh_node_id_lease(&self) -> trc::Result<()> {
|
||||
let mut batch = BatchBuilder::new();
|
||||
batch
|
||||
.assert_value(ValueClass::NodeId(self.0.node_id), ())
|
||||
.set(
|
||||
ValueClass::NodeId(self.0.node_id),
|
||||
KeySerializer::new(self.0.env_hostname.len() + U64_LEN)
|
||||
.write(now())
|
||||
.write(&self.0.env_hostname)
|
||||
.finalize(),
|
||||
);
|
||||
batch.set(
|
||||
ValueClass::NodeId(self.0.node_id),
|
||||
KeySerializer::new(self.0.env_hostname.len() + U64_LEN)
|
||||
.write(now())
|
||||
.write(&self.0.env_hostname)
|
||||
.finalize(),
|
||||
);
|
||||
self.0
|
||||
.store
|
||||
.write(batch.build_all())
|
||||
|
||||
Reference in New Issue
Block a user