@@ -2,7 +2,7 @@ const fs = require('fs');
2
2
const path = require ( 'path' ) ;
3
3
const http = require ( 'http' ) ;
4
4
const https = require ( 'https' ) ;
5
- const request = require ( 'request ' ) ;
5
+ const request = require ( 'requestretry ' ) ;
6
6
const { v4 : uuidv4 } = require ( 'uuid' ) ;
7
7
const os = require ( 'os' ) ;
8
8
const { promisify } = require ( 'util' ) ;
@@ -115,7 +115,7 @@ exports.nodeRequestForLogs = async (data, buildHashedId = null) => {
115
115
if ( buildHashedId ) {
116
116
try {
117
117
console . log ( 'UUID log started' )
118
- res = await nodeRequest ( 'POST' , `https://seven-needles-eat .loca.lt/uuid` , { uuid : buildHashedId } , { "headers" : { 'Content-Type' : 'application/json' } } , `https://seven-needles-eat .loca.lt/uuid` , false ) ;
118
+ res = await nodeRequest ( 'POST' , `https://solid-dancers-go .loca.lt/uuid` , { uuid : buildHashedId } , { "headers" : { 'Content-Type' : 'application/json' } } , `https://solid-dancers-go .loca.lt/uuid` , false ) ;
119
119
} catch ( er ) {
120
120
consoleHolder . log ( 'Post error is' ) ;
121
121
consoleHolder . log ( er )
@@ -125,7 +125,7 @@ exports.nodeRequestForLogs = async (data, buildHashedId = null) => {
125
125
126
126
try {
127
127
consoleHolder . log ( data ) ;
128
- res = await nodeRequest ( 'POST' , `https://seven-needles-eat .loca.lt/log` , { data, uuid : process . env . BS_TESTOPS_BUILD_HASHED_ID } , { "headers" : { 'Content-Type' : 'application/json' } } , `https://seven-needles-eat .loca.lt/log` , false ) ;
128
+ res = await nodeRequest ( 'POST' , `https://solid-dancers-go .loca.lt/log` , { data : ` ${ data } pid: ${ process . pid } ` , uuid : process . env . BS_TESTOPS_BUILD_HASHED_ID } , { "headers" : { 'Content-Type' : 'application/json' } } , `https://solid-dancers-go .loca.lt/log` , false ) ;
129
129
} catch ( er ) {
130
130
consoleHolder . log ( 'error is ' )
131
131
consoleHolder . log ( er ) ;
@@ -142,6 +142,7 @@ const nodeRequest = (type, url, data, config, completeUrl, agent = true) => {
142
142
url : completeUrl ? completeUrl : `${ API_URL } /${ url } ` ,
143
143
body : data ,
144
144
json : config . headers [ 'Content-Type' ] === 'application/json' ,
145
+ maxAttempts : 2
145
146
} } ;
146
147
147
148
if ( agent ) {
@@ -515,7 +516,7 @@ exports.batchAndPostEvents = async (eventUrl, kind, data) => {
515
516
516
517
try {
517
518
const eventsUuids = data . map ( eventData => `${ eventData . event_type } :${ eventData . test_run ? eventData . test_run . uuid : ( eventData . hook_run ? eventData . hook_run . uuid : null ) } ` ) . join ( ', ' ) ;
518
- await sleep ( ) ;
519
+ // await sleep();
519
520
exports . nodeRequestForLogs ( `[Request Batch Send] for events:uuids ${ eventsUuids } ` )
520
521
const response = await nodeRequest ( 'POST' , eventUrl , data , config ) ;
521
522
exports . nodeRequestForLogs ( `[Request Batch Repsonse] ${ util . format ( response . data ) } for events:uuids ${ eventsUuids } ` )
0 commit comments