Compare commits

..

1 Commits

Author SHA1 Message Date
fiatjaf
61a68f3dca fix faulty outbox database check logic when it doesn't exist.
fixes https://github.com/fiatjaf/nak/issues/66
2025-05-21 14:12:22 -03:00
2 changed files with 3 additions and 3 deletions

View File

@@ -85,7 +85,7 @@ var app = &cli.Command{
sys = sdk.NewSystem() sys = sdk.NewSystem()
if err := initializeOutboxHintsDB(c, sys); err != nil { if err := initializeOutboxHintsDB(c, sys); err != nil {
return ctx, fmt.Errorf("failed to initialized outbox hints: %w", err) return ctx, fmt.Errorf("failed to initialize outbox hints: %w", err)
} }
sys.Pool = nostr.NewPool(nostr.PoolOptions{ sys.Pool = nostr.NewPool(nostr.PoolOptions{

View File

@@ -29,9 +29,9 @@ func initializeOutboxHintsDB(c *cli.Command, sys *sdk.System) error {
hintsFilePath = filepath.Join(configPath, "outbox/hints.bg") hintsFilePath = filepath.Join(configPath, "outbox/hints.bg")
} }
if hintsFilePath != "" { if hintsFilePath != "" {
if _, err := os.Stat(hintsFilePath); !os.IsNotExist(err) { if _, err := os.Stat(hintsFilePath); err == nil {
hintsFileExists = true hintsFileExists = true
} else if err != nil { } else if !os.IsNotExist(err) {
return err return err
} }
} }