-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Azure Redis private endpoint; config geoprocessing for deployment…
…; refactor redis config loading
- Loading branch information
Showing
44 changed files
with
372 additions
and
331 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import * as config from 'config'; | ||
import { QueueBaseOptions } from 'bullmq/dist/interfaces/queue-options'; | ||
|
||
export function getRedisConfig() { | ||
const redisConfig: Record<string, any> = config.get('redis'); | ||
const useTLS: boolean = `${redisConfig.useTLS}`.toLowerCase() === 'true'; | ||
|
||
const redisSettings: QueueBaseOptions = { | ||
connection: { | ||
host: redisConfig.host, | ||
port: redisConfig.port, | ||
password: redisConfig.password, | ||
tls: useTLS | ||
? { | ||
host: redisConfig.host, | ||
port: redisConfig.port, | ||
} | ||
: undefined, | ||
}, | ||
}; | ||
|
||
return redisSettings; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
{ | ||
"redisApi": { | ||
"connection": { | ||
"host": "test-e2e-redis", | ||
"port": "6379" | ||
} | ||
"redis": { | ||
"host": "test-e2e-redis", | ||
"port": "6379" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,16 @@ | ||
import * as config from 'config'; | ||
import { Injectable } from '@nestjs/common'; | ||
import { WorkerOptions } from 'bullmq'; | ||
import { getRedisConfig } from '@marxan-geoprocessing/utils/redisConfig.utils'; | ||
|
||
@Injectable() | ||
export class Config { | ||
public readonly redis: WorkerOptions; | ||
|
||
constructor() { | ||
this.redis = config.get('redisApi'); | ||
this.redis = { | ||
...getRedisConfig(), | ||
concurrency: config.get('redis.concurrency'), | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import * as config from 'config'; | ||
import { QueueBaseOptions } from 'bullmq/dist/interfaces/queue-options'; | ||
|
||
export function getRedisConfig() { | ||
const redisConfig: Record<string, any> = config.get('redis'); | ||
const useTLS: boolean = `${redisConfig.useTLS}`.toLowerCase() === 'true'; | ||
|
||
const redisSettings: QueueBaseOptions = { | ||
connection: { | ||
host: redisConfig.host, | ||
port: redisConfig.port, | ||
password: redisConfig.password, | ||
tls: useTLS | ||
? { | ||
host: redisConfig.host, | ||
port: redisConfig.port, | ||
} | ||
: undefined, | ||
}, | ||
}; | ||
|
||
return redisSettings; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.