make load_or_create *only* load_or_create

Extracted the other logic to its current singular callsite for now.

The load_or_create function finally does nothing other than load or
create the database (and do some related checks, which is fine). This
paves the way for more/better database surgery tooling.
This commit is contained in:
Charles Hall 2024-09-24 17:44:33 -07:00
parent e9caf228b3
commit c2c6083277
No known key found for this signature in database
GPG key ID: 7B8E0645816E07CF
3 changed files with 56 additions and 52 deletions

View file

@ -61,6 +61,18 @@ pub(crate) enum ServeCommand {
#[error("failed to serve requests")]
Serve(#[from] Serve),
#[error("failed to initialize services")]
InitializeServices(#[source] crate::utils::error::Error),
#[error("failed to check if there are any users")]
NonZeroUsers(#[source] crate::utils::error::Error),
#[error("failed to check if the admin bot exists")]
AdminBotExists(#[source] crate::utils::error::Error),
#[error("`server_name` in the database and config file differ")]
Renamed,
}
/// Observability initialization errors