Skip to content

Commit

Permalink
PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminjb committed Jan 6, 2024
1 parent c5e11bf commit e899779
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion internal/pgmonitor/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,9 @@ func ExporterStartCommand(builtinCollectors bool, commandFlags ...string) []stri
` [ -e /proc/$! ] && echo $! > $POSTGRES_EXPORTER_PIDFILE`,
`}`,

// run function to combine queries files and start postgres_exporter
`start_postgres_exporter`,

// Create a file descriptor with a no-op process that will not get
// cleaned up
`exec {fd}<> <(:)`,
Expand All @@ -178,7 +181,7 @@ func ExporterStartCommand(builtinCollectors bool, commandFlags ...string) []stri

// If postgres_exporter is not running, restart it
// Use the recorded pid as a proxy for checking if postgres_exporter is running
` if [ ! -e $POSTGRES_EXPORTER_PIDFILE ] || [ ! -e /proc/$(head -1 ${POSTGRES_EXPORTER_PIDFILE?}) ] ; then`,
` if [ ! -e /proc/$(head -1 ${POSTGRES_EXPORTER_PIDFILE?}) ] ; then`,
` start_postgres_exporter`,
` fi`,
`done`,
Expand Down

0 comments on commit e899779

Please sign in to comment.