LP#1492793: teach Clark Kent to set the Pg app name
authorGalen Charlton <gmc@esilibrary.com>
Tue, 16 Feb 2016 20:36:26 +0000 (15:36 -0500)
committerGalen Charlton <gmc@esilibrary.com>
Tue, 16 Feb 2016 20:40:37 +0000 (15:40 -0500)
commitfb7ec38ca9a263926f2593bac019e528f3f07aab
tree29fe5553c81985099ce5e9aff80e231b8e4049b9
parent1598c2b64036a1c6e1006fd15a0f83ee70971b36
LP#1492793: teach Clark Kent to set the Pg app name

Clark Kent can now also use the application_name
setting in the relevant sections of opensrf.xml to
set the Pg application name.

To test:

[1] Apply the patch, restarting opensrf.settings, and
    start Clark.
[2] Run a report that will take at least a minute to
    finish. While it is running, query the pg_stat_activity
    table. There should be at least one row where the
    application_name column is set to 'Clark Kent (reports)'.
[3] Note that since the master Clark process opens a database
    connection, checks whether there are any reports to run,
    then immediately closes the connection, it's unlikely that
    you'll catch a 'Clark Kent (state)' connection when
    querying pg_stat_activity.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Open-ILS/examples/opensrf.xml.example
Open-ILS/src/reporter/clark-kent.pl