fix: 按完成时刻分批清理并限制读连接池
This commit is contained in:
@@ -107,8 +107,8 @@ func (a *App) Recall(ctx context.Context, senderID string, req *protocol.Recall)
|
||||
return err
|
||||
}
|
||||
if state == StateScheduled {
|
||||
if _, e := tx.Exec(`UPDATE messages SET state = ?, reason = ? WHERE seq = ? AND state = 'scheduled'`,
|
||||
StateCompleted, ReasonRecalled, seq); e != nil {
|
||||
if _, e := tx.Exec(`UPDATE messages SET state = ?, reason = ?, completed_at = ? WHERE seq = ? AND state = 'scheduled'`,
|
||||
StateCompleted, ReasonRecalled, nowMs, seq); e != nil {
|
||||
return e
|
||||
}
|
||||
if _, e := tx.Exec(`DELETE FROM message_bodies WHERE seq = ?`, seq); e != nil {
|
||||
|
||||
Reference in New Issue
Block a user