1
0
mirror of https://github.com/pocket-id/pocket-id.git synced 2026-03-22 23:05:09 +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

@@ -2,6 +2,7 @@ package bootstrap
import (
"context"
"errors"
"fmt"
"log/slog"
"time"
@@ -11,6 +12,7 @@ import (
"github.com/pocket-id/pocket-id/backend/internal/common"
"github.com/pocket-id/pocket-id/backend/internal/job"
"github.com/pocket-id/pocket-id/backend/internal/service"
"github.com/pocket-id/pocket-id/backend/internal/storage"
"github.com/pocket-id/pocket-id/backend/internal/utils"
)
@@ -60,7 +62,9 @@ func Bootstrap(ctx context.Context) error {
}
waitUntil, err := svc.appLockService.Acquire(ctx, false)
if err != nil {
if errors.Is(err, service.ErrLockUnavailable) {
return errors.New("it appears that there's already one instance of Pocket ID running; running multiple replicas of Pocket ID is currently not supported")
} else if err != nil {
return fmt.Errorf("failed to acquire application lock: %w", err)
}