@@ -596,7 +596,7 @@ func (b *ByocAws) CreateUploadURL(ctx context.Context, req *defangv1.UploadURLRe
596
596
}, nil
597
597
}
598
598
599
- func (b * ByocAws ) Query (ctx context.Context , req * defangv1.DebugRequest ) error {
599
+ func (b * ByocAws ) QueryForDebug (ctx context.Context , req * defangv1.DebugRequest ) error {
600
600
// tailRequest := &defangv1.TailRequest{
601
601
// Etag: req.Etag,
602
602
// Project: req.Project,
@@ -695,11 +695,11 @@ func (b *ByocAws) Follow(ctx context.Context, req *defangv1.TailRequest) (client
695
695
// * Etag, service: tail that task/service
696
696
var err error
697
697
var taskArn ecs.TaskArn
698
- var eventStream ecs.EventStream
698
+ var tailStream ecs.LiveTailStream
699
699
stopWhenCDTaskDone := false
700
700
logType := logs .LogType (req .LogType )
701
701
if etag != "" && ! pkg .IsValidRandomID (etag ) { // Assume invalid "etag" is a task ID
702
- eventStream , err = b .driver .TailTaskID (ctx , etag )
702
+ tailStream , err = b .driver .TailTaskID (ctx , etag )
703
703
taskArn , _ = b .driver .GetTaskArn (etag )
704
704
term .Debugf ("Tailing task %s" , * taskArn )
705
705
etag = "" // no need to filter by etag
@@ -709,7 +709,14 @@ func (b *ByocAws) Follow(ctx context.Context, req *defangv1.TailRequest) (client
709
709
if len (req .Services ) == 1 {
710
710
service = req .Services [0 ]
711
711
}
712
- eventStream , err = ecs .TailLogGroups (ctx , req .Since .AsTime (), b .getLogGroupInputs (etag , req .Project , service , req .Pattern , logType )... )
712
+ var start , end time.Time
713
+ if req .Since .IsValid () {
714
+ start = req .Since .AsTime ()
715
+ }
716
+ if req .Until .IsValid () {
717
+ end = req .Until .AsTime ()
718
+ }
719
+ tailStream , err = ecs .QueryAndTailLogGroups (ctx , start , end , b .getLogGroupInputs (etag , req .Project , service , req .Pattern , logType )... )
713
720
taskArn = b .cdTaskArn
714
721
}
715
722
if err != nil {
@@ -731,7 +738,7 @@ func (b *ByocAws) Follow(ctx context.Context, req *defangv1.TailRequest) (client
731
738
}()
732
739
}
733
740
734
- return newByocServerStream (ctx , eventStream , etag , req .GetServices (), b ), nil
741
+ return newByocServerStream (ctx , tailStream , etag , req .GetServices (), b ), nil
735
742
}
736
743
737
744
func (b * ByocAws ) makeLogGroupARN (name string ) string {
0 commit comments