Przeglądaj źródła

clean up comments and debug statements

Alexander Belanger 4 lat temu
rodzic
commit
4124f5afcc

+ 1 - 1
internal/repository/gorm/cluster.go

@@ -152,7 +152,7 @@ func (repo *ClusterRepository) CreateCluster(
 
 	cluster.TokenCacheID = cluster.TokenCache.ID
 
-	if err := ctxDB.Debug().Save(cluster).Error; err != nil {
+	if err := ctxDB.Save(cluster).Error; err != nil {
 		return nil, err
 	}
 

+ 2 - 2
internal/repository/gorm/event.go

@@ -99,7 +99,7 @@ func (repo *KubeEventRepository) CreateEvent(
 	// basic fixed-length buffer
 	if count >= 500 {
 		// first, delete the matching sub events
-		err := repo.db.Debug().Exec(`
+		err := repo.db.Exec(`
 		  DELETE FROM kube_sub_events 
 		  WHERE kube_event_id IN (
 			SELECT id FROM kube_events k2 WHERE (k2.project_id = ? AND k2.cluster_id = ?) AND k2.id NOT IN (
@@ -113,7 +113,7 @@ func (repo *KubeEventRepository) CreateEvent(
 		}
 
 		// then, delete the matching events
-		err = repo.db.Debug().Exec(`
+		err = repo.db.Exec(`
 		  DELETE FROM kube_events 
 		  WHERE (project_id = ? AND cluster_id = ?) AND id NOT IN (
 			SELECT id FROM kube_events k2 WHERE (k2.project_id = ? AND k2.cluster_id = ?) ORDER BY k2.updated_at desc, k2.id desc LIMIT 499

+ 0 - 2
services/job_sidecar_container/job_killer.sh

@@ -40,8 +40,6 @@ graceful_shutdown() {
 
     echo "searching for process pattern: $pattern"
 
-    # local target_pid_arr=$(ps x | grep -v './job_killer.sh' | grep "$pattern" | awk '{ printf "%d ", $1 }' | sort)
-    # local target_pid=$target_pid_arr
     local target_pid=$(pgrep -f $pattern -l | grep -v 'job_killer.sh' | grep -v 'wait_for_job.sh' | grep -v 'grep' | awk '{ printf "%d ", $1 }' | sort)
     local list="$target_pid"
 

+ 0 - 7
services/job_sidecar_container/wait_for_job.sh

@@ -8,14 +8,7 @@ pattern=$1
 
 target_pid=$(pgrep -f $pattern -l | grep -v 'job_killer.sh' | grep -v 'wait_for_job.sh' | grep -v 'grep' | awk '{ printf "%d ", $1 }' | sort)
 
-
-# target_pid_arr=$(ps x | grep -v './job_killer.sh' | grep -v './wait_for_job.sh' | grep "$pattern" | awk '{ printf "%d ", $1 }' | sort)
-# target_pid=$target_pid_arr
-
 while [ ! "$target_pid" ]; do 
   sleep 0.1
   target_pid=$(pgrep -f $pattern -l | grep -v 'job_killer.sh' | grep -v 'wait_for_job.sh' | grep -v 'grep' | awk '{ printf "%d ", $1 }' | sort)
-
-#   target_pid_arr=$(ps x | grep -v './job_killer.sh' | grep -v './wait_for_job.sh' | grep "$pattern" | awk '{ printf "%d ", $1 }' | sort)
-#   target_pid=$target_pid_arr
 done