mirror of https://github.com/fiatjaf/nak.git
fix faulty outbox database check logic when it doesn't exist.
fixes https://github.com/fiatjaf/nak/issues/66
This commit is contained in:
parent
f450e735b6
commit
61a68f3dca
2
main.go
2
main.go
|
@ -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{
|
||||||
|
|
|
@ -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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue