@@ -596,7 +596,7 @@ func (b *ByocAws) CreateUploadURL(ctx context.Context, req *defangv1.UploadURLRe
596596 }, nil
597597}
598598
599- func (b * ByocAws ) Query (ctx context.Context , req * defangv1.DebugRequest ) error {
599+ func (b * ByocAws ) QueryForDebug (ctx context.Context , req * defangv1.DebugRequest ) error {
600600 // tailRequest := &defangv1.TailRequest{
601601 // Etag: req.Etag,
602602 // Project: req.Project,
@@ -695,11 +695,11 @@ func (b *ByocAws) Follow(ctx context.Context, req *defangv1.TailRequest) (client
695695 // * Etag, service: tail that task/service
696696 var err error
697697 var taskArn ecs.TaskArn
698- var eventStream ecs.EventStream
698+ var tailStream ecs.LiveTailStream
699699 stopWhenCDTaskDone := false
700700 logType := logs .LogType (req .LogType )
701701 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 )
703703 taskArn , _ = b .driver .GetTaskArn (etag )
704704 term .Debugf ("Tailing task %s" , * taskArn )
705705 etag = "" // no need to filter by etag
@@ -709,7 +709,14 @@ func (b *ByocAws) Follow(ctx context.Context, req *defangv1.TailRequest) (client
709709 if len (req .Services ) == 1 {
710710 service = req .Services [0 ]
711711 }
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 )... )
713720 taskArn = b .cdTaskArn
714721 }
715722 if err != nil {
@@ -731,7 +738,7 @@ func (b *ByocAws) Follow(ctx context.Context, req *defangv1.TailRequest) (client
731738 }()
732739 }
733740
734- return newByocServerStream (ctx , eventStream , etag , req .GetServices (), b ), nil
741+ return newByocServerStream (ctx , tailStream , etag , req .GetServices (), b ), nil
735742}
736743
737744func (b * ByocAws ) makeLogGroupARN (name string ) string {
0 commit comments