@@ -40,8 +40,8 @@ func RunEstimate(ctx context.Context, project *compose.Project, client client.Fa
40
40
}
41
41
42
42
func GeneratePreview (ctx context.Context , project * compose.Project , client client.FabricClient , previewProvider client.Provider , estimateProviderID client.ProviderID , mode defangv1.DeploymentMode , region string ) (string , error ) {
43
- os .Setenv ("DEFANG_JSON" , "1" ) // HACK: always show JSON output for estimate
44
- since := time .Now ()
43
+ os .Setenv ("DEFANG_JSON" , "1" ) // HACK: always show JSON output for estimate
44
+ since := time .Now (). Add ( - 1 * time . Minute ) // fetch logs since one minute ago to account for clock drift
45
45
46
46
fixedProject := project .WithoutUnnecessaryResources ()
47
47
if err := compose .FixupServices (ctx , previewProvider , fixedProject , compose .UploadModeEstimate ); err != nil {
@@ -68,14 +68,14 @@ func GeneratePreview(ctx context.Context, project *compose.Project, client clien
68
68
69
69
term .Info ("Generating deployment preview, this may take a few minutes..." )
70
70
var pulumiPreviewLogLines []string
71
- options := TailOptions {
71
+ tailOptions := TailOptions {
72
72
Deployment : resp .Etag ,
73
- Since : since ,
74
73
LogType : logs .LogTypeBuild ,
74
+ Since : since ,
75
75
Verbose : true ,
76
76
}
77
77
78
- err = streamLogs (ctx , previewProvider , project .Name , options , func (entry * defangv1.LogEntry , options * TailOptions ) error {
78
+ err = streamLogs (ctx , previewProvider , project .Name , tailOptions , func (entry * defangv1.LogEntry , options * TailOptions ) error {
79
79
if strings .HasPrefix (entry .Message , "Preview succeeded" ) {
80
80
return io .EOF
81
81
} else if strings .HasPrefix (entry .Message , "Preview failed" ) {
0 commit comments