@@ -83,7 +83,6 @@ type HealthResponse struct {
83
83
Status string `json:"status"`
84
84
Version string `json:"version"`
85
85
Uptime string `json:"uptime"`
86
- S3Bucket string `json:"s3_bucket"`
87
86
CacheSize string `json:"cache_size"`
88
87
CacheEntries int `json:"cache_entries"`
89
88
}
@@ -111,7 +110,7 @@ func getFromCache(ctx context.Context, version, path string) *CacheEntry {
111
110
cacheKey := fmt .Sprintf ("%s%s" , version , strings .TrimPrefix (path , "/" ))
112
111
113
112
// Log S3 access for debugging
114
- log .Printf ("S3 lookup: bucket=%s, key=%s" , s3Bucket , cacheKey )
113
+ // log.Printf("S3 lookup: bucket=%s, key=%s", s3Bucket, cacheKey)
115
114
116
115
// Check cache first
117
116
cacheMutex .RLock ()
@@ -136,7 +135,7 @@ func getFromCache(ctx context.Context, version, path string) *CacheEntry {
136
135
defer result .Body .Close ()
137
136
content , err := io .ReadAll (result .Body )
138
137
if err == nil {
139
- log .Printf ("S3 file found: %s (%d bytes)" , cacheKey , len (content ))
138
+ // log.Printf("S3 file found: %s (%d bytes)", cacheKey, len(content))
140
139
entry := & CacheEntry {
141
140
Exists : true ,
142
141
IsFile : true ,
@@ -147,10 +146,10 @@ func getFromCache(ctx context.Context, version, path string) *CacheEntry {
147
146
cacheMutex .Unlock ()
148
147
return entry
149
148
} else {
150
- log .Printf ("S3 file read error for %s: %v" , cacheKey , err )
149
+ // log.Printf("S3 file read error for %s: %v", cacheKey, err)
151
150
}
152
151
} else {
153
- log .Printf ("S3 file fetch error for %s: %v" , cacheKey , err )
152
+ // log.Printf("S3 file fetch error for %s: %v", cacheKey, err)
154
153
}
155
154
156
155
// Not a file, try as directory
@@ -169,7 +168,7 @@ func getFromCache(ctx context.Context, version, path string) *CacheEntry {
169
168
170
169
if err != nil {
171
170
s3ListErrors .Inc ()
172
- log .Printf ("S3 list error for key %s: %v" , cacheKey , err )
171
+ // log.Printf("S3 list error for key %s: %v", cacheKey, err)
173
172
// Cache as non-existent
174
173
entry := & CacheEntry {Exists : false }
175
174
cacheMutex .Lock ()
@@ -684,11 +683,14 @@ func buildTypeScript(code string, version string) BuildResponse {
684
683
685
684
if len (result .OutputFiles ) == 0 {
686
685
compileResults .WithLabelValues ("error" ).Inc ()
686
+ // log.Printf("Build failed: No output files generated")
687
687
return BuildResponse {Errors : []DiagnosticError {{Message : "No output generated" }}}
688
688
}
689
689
690
+ code := string (result .OutputFiles [0 ].Contents )
691
+ // log.Printf("Build successful: Generated %d bytes of code", len(code))
690
692
compileResults .WithLabelValues ("success" ).Inc ()
691
- return BuildResponse {Code : string ( result . OutputFiles [ 0 ]. Contents ) }
693
+ return BuildResponse {Code : code }
692
694
}
693
695
694
696
// Middleware for request logging
@@ -736,7 +738,6 @@ func health(w http.ResponseWriter, req *http.Request) {
736
738
Status : "healthy" ,
737
739
Version : serverVersion ,
738
740
Uptime : fmt .Sprintf ("%v" , uptime .Round (time .Second )),
739
- S3Bucket : s3Bucket ,
740
741
CacheSize : fmt .Sprintf ("%d MB" , cacheSize / (1024 * 1024 )),
741
742
CacheEntries : cacheEntries ,
742
743
}
@@ -750,8 +751,8 @@ func hello(w http.ResponseWriter, req *http.Request) {
750
751
http .NotFound (w , req )
751
752
return
752
753
}
753
- fmt .Fprintf (w , "TypeScript Go Server v%s\n Uptime: %v\n S3 Bucket: %s \ n " ,
754
- serverVersion , time .Since (startTime ).Round (time .Second ), s3Bucket )
754
+ fmt .Fprintf (w , "TypeScript Go Server v%s\n Uptime: %v\n " ,
755
+ serverVersion , time .Since (startTime ).Round (time .Second ))
755
756
}
756
757
757
758
func typecheck (w http.ResponseWriter , req * http.Request ) {
0 commit comments