mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
subscription start from specified timestamp
This commit is contained in:
parent
35869b5c80
commit
47a4963d7a
|
@ -38,11 +38,9 @@ func (b *MessageQueueBroker) Subscribe(req *mq_pb.SubscribeRequest, stream mq_pb
|
|||
}()
|
||||
|
||||
ctx := stream.Context()
|
||||
var startTime time.Time
|
||||
startTime := time.Now()
|
||||
if startTs := req.GetInit().GetStartTimestampNs(); startTs > 0 {
|
||||
startTime = time.Unix(0, startTs)
|
||||
} else {
|
||||
startTime = time.Now()
|
||||
}
|
||||
|
||||
localTopicPartition.Subscribe(clientName, startTime, func() bool {
|
||||
|
|
|
@ -30,7 +30,7 @@ func main() {
|
|||
Namespace: *namespace,
|
||||
Topic: *topic,
|
||||
Filter: "",
|
||||
StartTime: time.Unix(0, 0),
|
||||
StartTime: time.Unix(1, 1),
|
||||
}
|
||||
|
||||
processorConfig := sub_client.ProcessorConfiguration{
|
||||
|
|
Loading…
Reference in a new issue