Merge pull request 'fix(ci): rustfmt sidecar to unblock the release workflow' (#8) from fix/sidecar-rustfmt into main
All checks were successful
Release sidecar / release (push) Successful in 9m8s

Reviewed-on: UOM/link#8
Reviewed-by: Colby Whitlock <whitlocktech@gmail.com>
This commit is contained in:
2026-07-17 16:43:07 +00:00
2 changed files with 26 additions and 4 deletions

View File

@@ -142,7 +142,12 @@ async fn main() -> anyhow::Result<()> {
"guild.update" => { "guild.update" => {
if let Some(id) = ev.value.get("id").and_then(|v| v.as_i64()) { if let Some(id) = ev.value.get("id").and_then(|v| v.as_i64()) {
if let Err(e) = event_store if let Err(e) = event_store
.upsert_guild(id, ev.value.get("name").and_then(|n| n.as_str()), &text, t) .upsert_guild(
id,
ev.value.get("name").and_then(|n| n.as_str()),
&text,
t,
)
.await .await
{ {
tracing::warn!(error = %e, "failed to upsert guild board"); tracing::warn!(error = %e, "failed to upsert guild board");
@@ -170,7 +175,12 @@ async fn main() -> anyhow::Result<()> {
"house.update" => { "house.update" => {
if let Some(serial) = ev.value.get("serial").and_then(|s| s.as_str()) { if let Some(serial) = ev.value.get("serial").and_then(|s| s.as_str()) {
if let Err(e) = event_store if let Err(e) = event_store
.upsert_house(serial, ev.value.get("name").and_then(|n| n.as_str()), &text, t) .upsert_house(
serial,
ev.value.get("name").and_then(|n| n.as_str()),
&text,
t,
)
.await .await
{ {
tracing::warn!(error = %e, "failed to upsert house registry"); tracing::warn!(error = %e, "failed to upsert house registry");

View File

@@ -192,7 +192,13 @@ impl Store {
/// Upserts one guild's latest state, keyed by guild id. Fed from `guild.update`; one row per /// Upserts one guild's latest state, keyed by guild id. Fed from `guild.update`; one row per
/// guild, always the most recent snapshot. This is the board the website reads on load. /// guild, always the most recent snapshot. This is the board the website reads on load.
pub async fn upsert_guild(&self, id: i64, name: Option<&str>, json: &str, t: i64) -> anyhow::Result<()> { pub async fn upsert_guild(
&self,
id: i64,
name: Option<&str>,
json: &str,
t: i64,
) -> anyhow::Result<()> {
sqlx::query( sqlx::query(
"INSERT INTO guilds (id, name, json, updated_t) VALUES (?, ?, ?, ?) "INSERT INTO guilds (id, name, json, updated_t) VALUES (?, ?, ?, ?)
ON CONFLICT(id) DO UPDATE SET name = excluded.name, json = excluded.json, updated_t = excluded.updated_t", ON CONFLICT(id) DO UPDATE SET name = excluded.name, json = excluded.json, updated_t = excluded.updated_t",
@@ -250,7 +256,13 @@ impl Store {
// ---- house registry (Protocol 2.0) ---- // ---- house registry (Protocol 2.0) ----
/// Upserts one house's latest state, keyed by serial. Fed from `house.update`. /// Upserts one house's latest state, keyed by serial. Fed from `house.update`.
pub async fn upsert_house(&self, serial: &str, name: Option<&str>, json: &str, t: i64) -> anyhow::Result<()> { pub async fn upsert_house(
&self,
serial: &str,
name: Option<&str>,
json: &str,
t: i64,
) -> anyhow::Result<()> {
sqlx::query( sqlx::query(
"INSERT INTO houses (serial, name, json, updated_t) VALUES (?, ?, ?, ?) "INSERT INTO houses (serial, name, json, updated_t) VALUES (?, ?, ?, ?)
ON CONFLICT(serial) DO UPDATE SET name = excluded.name, json = excluded.json, updated_t = excluded.updated_t", ON CONFLICT(serial) DO UPDATE SET name = excluded.name, json = excluded.json, updated_t = excluded.updated_t",