Skip to content

Commit

Permalink
Merge pull request #133 from Tibz-Dankan/integrate/mail-jet
Browse files Browse the repository at this point in the history
fix: implement a custom  method 'Flush()' for the responseWriter to r…
  • Loading branch information
Tibz-Dankan authored Aug 14, 2024
2 parents c35655b + 8ff437c commit 1c25d26
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions internal/middlewares/requestDuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,9 @@ func (rw *responseWriter) WriteHeader(code int) {
rw.statusCode = code
rw.ResponseWriter.WriteHeader(code)
}

func (rw *responseWriter) Flush() {
if flusher, ok := rw.ResponseWriter.(http.Flusher); ok {
flusher.Flush()
}
}
1 change: 0 additions & 1 deletion internal/routes/request/makeRequest.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@ func validateApp(app models.App) (bool, error) {
endTime, _ := appDateEnd.HourMinSecTime()
currentTimeStart, _ := appDateStart.CurrentTime()
currentTimeEnd, _ := appDateEnd.CurrentTime()
// log.Printf("app:%s rs:%s startTime:%s re:%s endTime: %s\n", app.Name, rt.Start, startTime, rt.End, endTime)

isEqualToStartTime := currentTimeStart.Equal(startTime)
isEqualToEndTime := currentTimeEnd.Equal(endTime)
Expand Down
1 change: 1 addition & 0 deletions internal/services/date.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ func (d *Date) ISOTime() (time.Time, error) {

// Return the date string in the format
// "2006-01-02 15:04:05.999999999 -0700 MST"
// in the provided timezone
func (d *Date) hourMinSecStr() string {
currentTime, _ := d.CurrentTime()

Expand Down

0 comments on commit 1c25d26

Please sign in to comment.