1
0
mirror of https://github.com/lus/pasty.git synced 2023-08-10 21:13:09 +03:00

Fix cleanup SQL query

This commit is contained in:
Lukas Schulte Pelkum 2022-01-30 21:53:36 +01:00
parent f371f4e043
commit 317d7e6d88
No known key found for this signature in database
GPG Key ID: 408DA7CA81DB885C

View File

@ -117,7 +117,7 @@ func (driver *PostgresDriver) Delete(id string) error {
// Cleanup cleans up the expired pastes
func (driver *PostgresDriver) Cleanup() (int, error) {
query := "DELETE FROM pastes WHERE created < $2"
query := "DELETE FROM pastes WHERE created < $1"
tag, err := driver.pool.Exec(context.Background(), query, time.Now().Add(-config.Current.AutoDelete.Lifetime).Unix())
if err != nil {