Skip to content

Commit

Permalink
Use ts as msgID for request
Browse files Browse the repository at this point in the history
Signed-off-by: Cai Zhang <[email protected]>
  • Loading branch information
xiaocai2333 committed Oct 31, 2024
1 parent b849249 commit edc0ba7
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions internal/proxy/task_scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,18 +177,14 @@ func (queue *baseTaskQueue) Enqueue(t task) error {
var id UniqueID
if t.CanSkipAllocTimestamp() {
ts = tsoutil.ComposeTS(time.Now().UnixMilli(), 0)
id, err = globalMetaCache.AllocID(t.TraceCtx())
if err != nil {
return err
}
} else {
ts, err = queue.tsoAllocatorIns.AllocOne(t.TraceCtx())
if err != nil {
return err
}
// we always use same msg id and ts for now.
id = UniqueID(ts)
}
// we always use same msg id and ts for now.
id = UniqueID(ts)
t.SetTs(ts)
t.SetID(id)

Expand Down

0 comments on commit edc0ba7

Please sign in to comment.