mirror of
https://github.com/photoprism/photoprism.git
synced 2025-12-12 00:34:13 +01:00
CLI: Added JWT issuance and diagnostics sub commands #5230
Signed-off-by: Michael Mayer <michael@photoprism.app>
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user