mirror of
https://github.com/chaitin/MonkeyCode.git
synced 2026-11-22 03:18:50 +08:00
- WebSocket 连接时只推送当前论次消息,不再拉取全部历史 - 通过 FindLastEvent 查找最后一个 task-started 确定论次起始 - 移除 ChunkAggregator,直接透传 Loki 中已聚合的 TaskChunk - 推送完当前论次后发送 cursor 消息供前端翻页 - 新增 GET /api/v1/users/tasks/rounds 接口,支持 cursor 向前分页查询原始日志
24 lines
545 B
Go
24 lines
545 B
Go
package delayqueue
|
|
|
|
import (
|
|
"log/slog"
|
|
"time"
|
|
|
|
"github.com/redis/go-redis/v9"
|
|
|
|
"github.com/chaitin/MonkeyCode/backend/domain"
|
|
)
|
|
|
|
// VMExpireQueue VM 过期队列
|
|
type VMExpireQueue struct {
|
|
*RedisDelayQueue[*domain.VmExpireInfo]
|
|
}
|
|
|
|
func NewVMExpireQueue(rdb *redis.Client, logger *slog.Logger) *VMExpireQueue {
|
|
return &VMExpireQueue{NewRedisDelayQueue(rdb, logger,
|
|
WithPrefix[*domain.VmExpireInfo]("mcai:vmexpire"),
|
|
WithPollInterval[*domain.VmExpireInfo](5*time.Second),
|
|
WithRequeueDelay[*domain.VmExpireInfo](1*time.Minute),
|
|
)}
|
|
}
|