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:
parent
f371f4e043
commit
317d7e6d88
@ -117,7 +117,7 @@ func (driver *PostgresDriver) Delete(id string) error {
|
|||||||
|
|
||||||
// Cleanup cleans up the expired pastes
|
// Cleanup cleans up the expired pastes
|
||||||
func (driver *PostgresDriver) Cleanup() (int, error) {
|
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())
|
tag, err := driver.pool.Exec(context.Background(), query, time.Now().Add(-config.Current.AutoDelete.Lifetime).Unix())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user