File tree Expand file tree Collapse file tree 4 files changed +9
-0
lines changed
packages/core/src/v3/runEngineWorker/supervisor Expand file tree Collapse file tree 4 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -130,6 +130,7 @@ class ManagedSupervisor {
130
130
maxConsumerCount : env . TRIGGER_DEQUEUE_MAX_CONSUMER_COUNT ,
131
131
runNotificationsEnabled : env . TRIGGER_WORKLOAD_API_ENABLED ,
132
132
heartbeatIntervalSeconds : env . TRIGGER_WORKER_HEARTBEAT_INTERVAL_SECONDS ,
133
+ sendRunDebugLogs : env . SEND_RUN_DEBUG_LOGS ,
133
134
preDequeue : async ( ) => {
134
135
if ( ! env . RESOURCE_MONITOR_ENABLED ) {
135
136
return { } ;
Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ export class SupervisorHttpClient {
33
33
private readonly workerToken : string ;
34
34
private readonly instanceName : string ;
35
35
private readonly defaultHeaders : Record < string , string > ;
36
+ private readonly sendRunDebugLogs : boolean ;
36
37
37
38
private readonly logger = new SimpleStructuredLogger ( "supervisor-http-client" ) ;
38
39
@@ -41,6 +42,7 @@ export class SupervisorHttpClient {
41
42
this . workerToken = opts . workerToken ;
42
43
this . instanceName = opts . instanceName ;
43
44
this . defaultHeaders = getDefaultWorkerHeaders ( opts ) ;
45
+ this . sendRunDebugLogs = opts . sendRunDebugLogs ?? false ;
44
46
45
47
if ( ! this . apiUrl ) {
46
48
throw new Error ( "apiURL is required and needs to be a non-empty string" ) ;
@@ -204,6 +206,10 @@ export class SupervisorHttpClient {
204
206
}
205
207
206
208
async sendDebugLog ( runId : string , body : WorkerApiDebugLogBody , runnerId ?: string ) : Promise < void > {
209
+ if ( ! this . sendRunDebugLogs ) {
210
+ return ;
211
+ }
212
+
207
213
try {
208
214
const res = await wrapZodFetch (
209
215
z . unknown ( ) ,
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ type SupervisorSessionOptions = SupervisorClientCommonOptions & {
21
21
preSkip ?: PreSkipFn ;
22
22
maxRunCount ?: number ;
23
23
maxConsumerCount ?: number ;
24
+ sendRunDebugLogs ?: boolean ;
24
25
} ;
25
26
26
27
export class SupervisorSession extends EventEmitter < WorkerEvents > {
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ export type SupervisorClientCommonOptions = {
6
6
instanceName : string ;
7
7
deploymentId ?: string ;
8
8
managedWorkerSecret ?: string ;
9
+ sendRunDebugLogs ?: boolean ;
9
10
} ;
10
11
11
12
export type PreDequeueFn = ( ) => Promise < {
You can’t perform that action at this time.
0 commit comments