create compat-id for messages && TestCreateCompatUser
This commit is contained in:
@@ -93,7 +93,7 @@ func (db *Database) ListRetrieableDeliveries(ctx TxContext, pageSize int) ([]mod
|
||||
return nil, err
|
||||
}
|
||||
|
||||
rows, err := tx.Query(ctx, "SELECT * FROM deliveries WHERE status = 'RETRY' AND next_delivery < :next LIMIT :lim ORDER BY next_delivery ASC", sq.PP{
|
||||
rows, err := tx.Query(ctx, "SELECT * FROM deliveries WHERE status = 'RETRY' AND next_delivery < :next ORDER BY next_delivery ASC LIMIT :lim", sq.PP{
|
||||
"next": time2DB(time.Now()),
|
||||
"lim": pageSize,
|
||||
})
|
||||
|
@@ -66,8 +66,8 @@ func (db *Database) InsertRequestLog(ctx context.Context, requestid models.Reque
|
||||
}
|
||||
|
||||
func (db *Database) Cleanup(ctx context.Context, count int, duration time.Duration) (int64, error) {
|
||||
res1, err := db.db.Exec(ctx, "DELETE FROM requests WHERE request_id NOT IN ( SELECT request_id FROM requests ORDER BY timestamp_created DESC LIMIT :lim ) ", sq.PP{
|
||||
"lim": count,
|
||||
res1, err := db.db.Exec(ctx, "DELETE FROM requests WHERE request_id NOT IN ( SELECT request_id FROM requests ORDER BY timestamp_created DESC LIMIT :keep ) ", sq.PP{
|
||||
"keep": count,
|
||||
})
|
||||
if err != nil {
|
||||
return 0, err
|
||||
|
Reference in New Issue
Block a user