File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -79,12 +79,21 @@ export class SplunkController {
7979 const restUrl = config . get < string > ( 'splunk.commands.splunkRestUrl' ) ;
8080 const token = config . get < string > ( 'splunk.commands.token' ) ;
8181 // Create a new SDK client if one hasn't been created or token / url settings have been changed
82- if ( ! this . _service || ( this . _service . _originalURL !== restUrl ) || ( this . _service . sessionKey !== token ) ) {
82+ if ( ( this . _service === undefined )
83+ || ( this . _service === null )
84+ || ( this . _service . _originalURL !== restUrl )
85+ || ( this . _service . sessionKey !== token )
86+ ) {
8387 this . _service = getClient ( ) ;
8488 // Check to see if the splunk deployment is part of a search head cluster, choose a single search head
8589 // to target if so to ensure that adhoc jobs are immediately available (without replication)
86- const newService = await getSearchHeadClusterMemberClient ( this . _service ) ;
87- this . _service = newService ;
90+ try {
91+ const newService = await getSearchHeadClusterMemberClient ( this . _service ) ;
92+ this . _service = newService ;
93+ } catch ( err ) {
94+ console . warn ( `Error retrieving search head cluster information:` ) ;
95+ console . warn ( err ) ;
96+ }
8897 }
8998 }
9099
You can’t perform that action at this time.
0 commit comments