1
0
mirror of https://github.com/pocket-id/pocket-id.git synced 2026-03-23 20:00:06 +00:00

fix: better error messages when there's another instance of Pocket ID running (#1370)

This commit is contained in:
Alessandro (Ale) Segala
2026-03-08 07:37:38 -07:00
committed by GitHub
parent e3905cf315
commit 832b7fbff4
3 changed files with 13 additions and 8 deletions

View File

@@ -119,11 +119,10 @@ func acquireImportLock(ctx context.Context, db *gorm.DB, force bool) error {
defer cancel()
waitUntil, err := appLockService.Acquire(opCtx, force)
if err != nil {
if errors.Is(err, service.ErrLockUnavailable) {
//nolint:staticcheck
return errors.New("Pocket ID must be stopped before importing data; please stop the running instance or run with --forcefully-acquire-lock to terminate the other instance")
}
if errors.Is(err, service.ErrLockUnavailable) {
//nolint:staticcheck
return errors.New("Pocket ID must be stopped before importing data; please stop the running instance or run with --forcefully-acquire-lock to terminate the other instance")
} else if err != nil {
return fmt.Errorf("failed to acquire application lock: %w", err)
}