refactor: The update checker has become the announcements checker

Replaces June's endpoint with a continuwuity endpoint.
Adds a JSON schema.

Closes #89
Closes #760
This commit is contained in:
Jade Ellis 2025-04-20 19:30:02 +01:00
parent 5486dbda24
commit 2d9bdc0979
No known key found for this signature in database
GPG key ID: 8705A2A3EBF77BD2
12 changed files with 238 additions and 166 deletions

View file

@ -11,7 +11,7 @@ pub(crate) enum GlobalsCommand {
CurrentCount,
LastCheckForUpdatesId,
LastCheckForAnnouncementsId,
/// - This returns an empty `Ok(BTreeMap<..>)` when there are no keys found
/// for the server.
@ -39,9 +39,12 @@ pub(super) async fn process(subcommand: GlobalsCommand, context: &Context<'_>) -
write!(context, "Query completed in {query_time:?}:\n\n```rs\n{results:#?}\n```")
},
| GlobalsCommand::LastCheckForUpdatesId => {
| GlobalsCommand::LastCheckForAnnouncementsId => {
let timer = tokio::time::Instant::now();
let results = services.updates.last_check_for_updates_id().await;
let results = services
.announcements
.last_check_for_announcements_id()
.await;
let query_time = timer.elapsed();
write!(context, "Query completed in {query_time:?}:\n\n```rs\n{results:#?}\n```")