diff --git a/basic/main.go b/basic/main.go index 141b31a..cc69a72 100644 --- a/basic/main.go +++ b/basic/main.go @@ -40,7 +40,7 @@ func (r *Relay) Init() error { for { time.Sleep(60 * time.Minute) - db.DB.Exec(`DELETE FROM event WHERE created_at < $1`, time.Now().AddDate(0, -3, 0)) // 3 months + db.DB.Exec(`DELETE FROM event WHERE created_at < $1`, time.Now().AddDate(0, -3, 0).Unix()) // 3 months } }() diff --git a/expensive/main.go b/expensive/main.go index 51f1176..f5e5fe7 100644 --- a/expensive/main.go +++ b/expensive/main.go @@ -3,8 +3,8 @@ package main import ( "encoding/json" "log" - "time" "net/http" + "time" "github.com/fiatjaf/relayer" "github.com/fiatjaf/relayer/storage/postgresql" @@ -40,7 +40,7 @@ func (r *Relay) Init() error { for { time.Sleep(60 * time.Minute) - db.DB.Exec(`DELETE FROM event WHERE created_at < $1`, time.Now().AddDate(0, -6, 0)) // 6 months + db.DB.Exec(`DELETE FROM event WHERE created_at < $1`, time.Now().AddDate(0, -3, 0).Unix()) // 6 months } }()