never store ephemeral events.

This commit is contained in:
fiatjaf
2022-11-03 14:30:53 -03:00
parent 13a0c45fff
commit b903f72945
2 changed files with 13 additions and 16 deletions

View File

@@ -4,7 +4,6 @@ import (
"encoding/json"
"fmt"
"strings"
"time"
"github.com/fiatjaf/go-nostr"
)
@@ -35,11 +34,5 @@ func (b *PostgresBackend) SaveEvent(evt *nostr.Event) error {
return fmt.Errorf("failed to save event %s: %w", evt.ID, err)
}
// delete ephemeral events after a minute
go func() {
time.Sleep(75 * time.Second)
b.DB.Exec("DELETE FROM event WHERE id = $1", evt.ID)
}()
return nil
}