CLI: Added JWT issuance and diagnostics sub commands #5230

Signed-off-by: Michael Mayer <michael@photoprism.app>
This commit is contained in:
Michael Mayer
2025-09-26 02:38:49 +02:00
parent 566eed05e0
commit 32c054da7a
35 changed files with 1354 additions and 84 deletions

View File

@@ -97,7 +97,6 @@ func RunWithTestContext(cmd *cli.Command, args []string) (output string, err err
// Ensure DB connection is open for each command run (some commands call Shutdown).
if c := get.Config(); c != nil {
_ = c.Init() // safe to call; re-opens DB if needed
c.RegisterDb() // (re)register provider
}
@@ -110,5 +109,11 @@ func RunWithTestContext(cmd *cli.Command, args []string) (output string, err err
err = cmd.Run(ctx, args...)
})
// Re-open the database after the command completed so follow-up checks
// (potentially issued by the test itself) have an active connection.
if c := get.Config(); c != nil {
c.RegisterDb()
}
return output, err
}