File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change 1
1
'use strict' ;
2
2
3
3
// Read environment variables
4
+ var authorized = true ;
4
5
const ZENDESK_USER = process . env . ZENDESK_USER ;
5
- if ( ! ZENDESK_USER ) {
6
- throw new Error ( 'Missing environment variable: ZENDESK_USER' )
7
- }
8
6
const ZENDESK_PASS = process . env . ZENDESK_PASS ;
9
- if ( ! ZENDESK_USER ) {
10
- throw new Error ( 'Missing environment variable: ZENDESK_PASS' )
7
+ let zendeskApiLimit ;
8
+ if ( ZENDESK_USER && ZENDESK_PASS ) {
9
+ console . log ( 'Zendesk credentials found.' ) ;
10
+ zendeskApiLimit = 400 ;
11
+ } else {
12
+ console . log ( 'Zendesk credentials not found.' ) ;
13
+ zendeskApiLimit = 200 ;
11
14
}
15
+ console . log ( `API requests per minute: ${ zendeskApiLimit } \n` ) ;
16
+
12
17
const AlgoliaID = process . env . ALGOLIA_APPLICATION_ID ;
13
18
const AlgoliaSecret = process . env . ALGOLIA_INDEXER_KEY ;
14
19
const AlgoliaIndexName = process . env . ALGOLIA_INDEX ;
You can’t perform that action at this time.
0 commit comments