Skip to content

Commit

Permalink
Refactor code to remove unnecessary print statements
Browse files Browse the repository at this point in the history
  • Loading branch information
andrasbacsai committed Oct 15, 2024
1 parent 696bbc9 commit cb0ff6b
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 5 deletions.
1 change: 0 additions & 1 deletion collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ func cleanup() {

cutoffTime := time.Now().AddDate(0, 0, -collectorRetentionPeriodDays).UnixMilli()

fmt.Println(cutoffTime)
_, err := db.Exec(`DELETE FROM cpu_usage WHERE CAST(time AS BIGINT) < ?`, cutoffTime)
if err != nil {
log.Printf("Error removing old data: %v", err)
Expand Down
2 changes: 0 additions & 2 deletions cpu.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package main

import (
"fmt"
"strconv"
"time"

Expand Down Expand Up @@ -37,7 +36,6 @@ func setupCpuRoutes(r *gin.Engine) {

// Validate date format
layout := "2006-01-02T15:04:05Z"
fmt.Println(from, to)
if from != "" {
if _, err := time.Parse(layout, from); err != nil {
c.JSON(400, gin.H{"error": "Invalid 'from' date format. Use YYYY-MM-DDTHH:MM:SSZ"})
Expand Down
2 changes: 0 additions & 2 deletions memory.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package main

import (
"fmt"
"math"
"strconv"
"time"
Expand Down Expand Up @@ -51,7 +50,6 @@ func setupMemoryRoutes(r *gin.Engine) {

// Validate date format
layout := "2006-01-02T15:04:05Z"
fmt.Println(from, to)
if from != "" {
if _, err := time.Parse(layout, from); err != nil {
c.JSON(400, gin.H{"error": "Invalid 'from' date format. Use YYYY-MM-DDTHH:MM:SSZ"})
Expand Down

0 comments on commit cb0ff6b

Please sign in to comment.