sync
This commit is contained in:
parent
0fa1de3b4e
commit
a755b4d2c8
6 changed files with 59 additions and 15 deletions
|
@ -147,9 +147,12 @@ func (ps *VehicleStore) Prune(ctx context.Context) (int64, error) {
|
|||
|
||||
// Avoid using sql idioms here for portability
|
||||
// SQLite and PgSQL do now() differently, we don't need to at all.
|
||||
res, err := ps.DB.ExecContext(ctx, `
|
||||
DELETE FROM vehicles WHERE last_updated < $1;
|
||||
`, time.Now().Add(-time.Minute*15))
|
||||
res, err := ps.DB.ExecContext(ctx,
|
||||
`
|
||||
DELETE FROM vehicles WHERE last_updated < $1;
|
||||
`,
|
||||
util.TimeToString(time.Now().Add(-time.Minute*15)),
|
||||
)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue