mirror of
https://github.com/fiatjaf/khatru.git
synced 2026-06-08 21:59:18 +02:00
never store ephemeral events.
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user