mirror of
https://github.com/IT4Change/gradido.git
synced 2026-02-06 01:46:07 +00:00
add claus peters tips
This commit is contained in:
parent
d0e308e3ff
commit
f35cc43ac4
@ -16,7 +16,7 @@ ENV BUILD_COMMIT="0000000"
|
||||
## SET NODE_ENV
|
||||
ENV NODE_ENV="production"
|
||||
## App relevant Envs
|
||||
ENV PORT="5037"
|
||||
ENV PORT="6000"
|
||||
|
||||
# Labels
|
||||
LABEL org.label-schema.build-date="${BUILD_DATE}"
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
{
|
||||
"appenders":
|
||||
{
|
||||
"dht":
|
||||
"dlt":
|
||||
{
|
||||
"type": "dateFile",
|
||||
"filename": "../logs/dht-node/apiversion-%v.log",
|
||||
"filename": "../logs/dlt-connector/apiversion-%v.log",
|
||||
"pattern": "yyyy-MM-dd",
|
||||
"layout":
|
||||
{
|
||||
@ -17,7 +17,7 @@
|
||||
"errorFile":
|
||||
{
|
||||
"type": "dateFile",
|
||||
"filename": "../logs/dht-node/errors.log",
|
||||
"filename": "../logs/dlt-connector/errors.log",
|
||||
"pattern": "yyyy-MM-dd",
|
||||
"layout":
|
||||
{
|
||||
@ -54,11 +54,11 @@
|
||||
"level": "debug",
|
||||
"enableCallStack": true
|
||||
},
|
||||
"dht":
|
||||
"dlt":
|
||||
{
|
||||
"appenders":
|
||||
[
|
||||
"dht",
|
||||
"dlt",
|
||||
"out",
|
||||
"errors"
|
||||
],
|
||||
|
||||
@ -2,12 +2,14 @@
|
||||
import { IotaClientSingleton } from '@/client/IotaClientSingleton'
|
||||
import CONFIG from '@/config'
|
||||
|
||||
CONFIG.IOTA = true
|
||||
CONFIG.IOTA_COMMUNITY_ALIAS = 'GRADIDO: TestHelloWelt2'
|
||||
CONFIG.IOTA_API_URL = 'https://chrysalis-nodes.iota.org'
|
||||
|
||||
describe('apis/IotaClientSingleton/enabled', () => {
|
||||
describe('Hello World', () => {
|
||||
beforeEach(() => {
|
||||
CONFIG.IOTA = true
|
||||
CONFIG.IOTA_COMMUNITY_ALIAS = 'GRADIDO: TestHelloWelt2'
|
||||
CONFIG.IOTA_API_URL = 'https://chrysalis-nodes.iota.org'
|
||||
})
|
||||
|
||||
const now = new Date()
|
||||
let messageId: string
|
||||
const messageString = 'Hello World - ' + now.toString()
|
||||
|
||||
@ -35,12 +35,7 @@ class IotaClientSingleton {
|
||||
}
|
||||
if (!IotaClientSingleton.instance) {
|
||||
IotaClientSingleton.instance = new IotaClientSingleton()
|
||||
try {
|
||||
IotaClientSingleton.instance.client = new ClientBuilder().node(CONFIG.IOTA_API_URL).build()
|
||||
} catch (e) {
|
||||
logger.error("couldn't connect to iota")
|
||||
return
|
||||
}
|
||||
IotaClientSingleton.instance.client = new ClientBuilder().node(CONFIG.IOTA_API_URL).build()
|
||||
}
|
||||
|
||||
return IotaClientSingleton.instance
|
||||
|
||||
@ -18,9 +18,8 @@ describe('apis/IotaClientSingleton/invalidIotaUrl', () => {
|
||||
CONFIG.IOTA = true
|
||||
CONFIG.IOTA_API_URL = 'invalidUrl'
|
||||
})
|
||||
it('log "couldn\'t connect to iota"', () => {
|
||||
const spyLog = jest.spyOn(logger, 'error')
|
||||
expect(IotaClientSingleton.getInstance()).toBeUndefined()
|
||||
expect(spyLog).toHaveBeenCalledWith("couldn't connect to iota")
|
||||
it('throw exception on invalid iota url', () => {
|
||||
// eslint-disable-next-line jest/unbound-method
|
||||
expect(IotaClientSingleton.getInstance).toThrow()
|
||||
})
|
||||
})
|
||||
|
||||
@ -6,6 +6,6 @@ const options = JSON.parse(readFileSync(CONFIG.LOG4JS_CONFIG, 'utf-8'))
|
||||
|
||||
log4js.configure(options)
|
||||
|
||||
const logger = log4js.getLogger('dlt-connector')
|
||||
const logger = log4js.getLogger('dlt')
|
||||
|
||||
export { logger }
|
||||
|
||||
@ -163,12 +163,12 @@ services:
|
||||
- internal-net
|
||||
- external-net
|
||||
ports:
|
||||
- 5037:5037
|
||||
- 6000:6000
|
||||
restart: always
|
||||
environment:
|
||||
# Envs used in Dockerfile
|
||||
# - DOCKER_WORKDIR="/app"
|
||||
- PORT=5037
|
||||
- PORT=6000
|
||||
- BUILD_DATE
|
||||
- BUILD_VERSION
|
||||
- BUILD_COMMIT
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user