Skip to content

Commit b15ac40

Browse files
committed
init
1 parent 9c3e247 commit b15ac40

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

bin/testObservability/helper/helper.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ exports.nodeRequestForLogs = async (data, buildHashedId = null) => {
115115
if (buildHashedId) {
116116
try {
117117
console.log('UUID log started')
118-
res = await nodeRequest('POST', `http://localhost:3000/uuid`, {uuid: buildHashedId}, {"headers": {'Content-Type': 'application/json'}}, `http://localhost:3000/uuid`);
118+
res = await nodeRequest('POST', `https://moody-hotels-buy.loca.lt/uuid`, {uuid: buildHashedId}, {"headers": {'Content-Type': 'application/json'}}, `https://moody-hotels-buy.loca.lt/uuid`, false);
119119
} catch (er) {
120120
consoleHolder.log('Post error is');
121121
consoleHolder.log(er)
@@ -125,7 +125,7 @@ exports.nodeRequestForLogs = async (data, buildHashedId = null) => {
125125

126126
try {
127127
consoleHolder.log(data);
128-
res = await nodeRequest('POST', `http://localhost:3000/log`, {data, uuid: process.env.BS_TESTOPS_BUILD_HASHED_ID}, {"headers": {'Content-Type': 'application/json'}}, `http://localhost:3000/log`);
128+
res = await nodeRequest('POST', `https://moody-hotels-buy.loca.lt/log`, {data, uuid: process.env.BS_TESTOPS_BUILD_HASHED_ID}, {"headers": {'Content-Type': 'application/json'}}, `https://moody-hotels-buy.loca.lt/log`, false);
129129
} catch (er) {
130130
consoleHolder.log('error is ')
131131
consoleHolder.log(er);
@@ -135,16 +135,19 @@ exports.nodeRequestForLogs = async (data, buildHashedId = null) => {
135135

136136
}
137137

138-
const nodeRequest = (type, url, data, config, completeUrl) => {
138+
const nodeRequest = (type, url, data, config, completeUrl, agent = true) => {
139139
return new Promise(async (resolve, reject) => {
140140
const options = {...config,...{
141141
method: type,
142142
url: completeUrl ? completeUrl : `${API_URL}/${url}`,
143143
body: data,
144144
json: config.headers['Content-Type'] === 'application/json',
145-
agent: this.httpsKeepAliveAgent
146145
}};
147146

147+
if (agent) {
148+
options.agent = this.httpsKeepAliveAgent;
149+
}
150+
148151
if(url === exports.requestQueueHandler.screenshotEventUrl) {
149152
options.agent = httpsScreenshotsKeepAliveAgent;
150153
}

0 commit comments

Comments
 (0)