11import { SimpleStructuredLogger } from "@trigger.dev/core/v3/utils/structuredLogger" ;
22import { K8sApi } from "../clients/kubernetes.js" ;
33import { createK8sApi } from "../clients/kubernetes.js" ;
4- import { HeartbeatService } from "@trigger.dev/core/v3" ;
4+ import { IntervalService } from "@trigger.dev/core/v3" ;
55import { Counter , Gauge , Registry } from "prom-client" ;
66import { register } from "../metrics.js" ;
77
@@ -19,7 +19,7 @@ export class PodCleaner {
1919 private readonly namespace : string ;
2020
2121 private readonly batchSize : number ;
22- private readonly deletionHeartbeat : HeartbeatService ;
22+ private readonly deletionInterval : IntervalService ;
2323
2424 // Metrics
2525 private readonly register : Registry ;
@@ -32,10 +32,10 @@ export class PodCleaner {
3232 this . namespace = opts . namespace ;
3333 this . batchSize = opts . batchSize ?? 500 ;
3434
35- this . deletionHeartbeat = new HeartbeatService ( {
35+ this . deletionInterval = new IntervalService ( {
3636 intervalMs : opts . intervalMs ?? 10000 ,
3737 leadingEdge : true ,
38- heartbeat : this . deleteCompletedPods . bind ( this ) ,
38+ onInterval : this . deleteCompletedPods . bind ( this ) ,
3939 } ) ;
4040
4141 // Initialize metrics
@@ -57,11 +57,11 @@ export class PodCleaner {
5757 }
5858
5959 async start ( ) {
60- this . deletionHeartbeat . start ( ) ;
60+ this . deletionInterval . start ( ) ;
6161 }
6262
6363 async stop ( ) {
64- this . deletionHeartbeat . stop ( ) ;
64+ this . deletionInterval . stop ( ) ;
6565 }
6666
6767 private async deleteCompletedPods ( ) {
0 commit comments