Skip to content

Commit 847d4fe

Browse files
committed
[*] respect --log-database-level when log to timetable.execution_log
1 parent 018dadd commit 847d4fe

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

internal/pgengine/access.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,14 @@ func (pge *PgEngine) IsAlive() bool {
2929

3030
// LogTaskExecution will log current chain element execution status including retcode
3131
func (pge *PgEngine) LogTaskExecution(ctx context.Context, task *ChainTask, retCode int, output string) {
32+
switch pge.Logging.LogDBLevel {
33+
case "none":
34+
return
35+
case "error":
36+
if task.IgnoreError || retCode == 0 {
37+
return
38+
}
39+
}
3240
_, err := pge.ConfigDb.Exec(ctx, `INSERT INTO timetable.execution_log (
3341
chain_id, task_id, command, kind, last_run, finished, returncode, pid, output, client_name, txid, ignore_error)
3442
VALUES ($1, $2, $3, $4, clock_timestamp() - $5 :: interval, clock_timestamp(), $6, $7, NULLIF($8, ''), $9, $10, $11)`,

0 commit comments

Comments
 (0)