@@ -2,7 +2,7 @@ const fs = require('fs');
22const path = require ( 'path' ) ;
33const http = require ( 'http' ) ;
44const https = require ( 'https' ) ;
5- const request = require ( 'request ' ) ;
5+ const request = require ( 'requestretry ' ) ;
66const { v4 : uuidv4 } = require ( 'uuid' ) ;
77const os = require ( 'os' ) ;
88const { promisify } = require ( 'util' ) ;
@@ -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' , `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 ) ;
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' , `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 ) ;
129129 } catch ( er ) {
130130 consoleHolder . log ( 'error is ' )
131131 consoleHolder . log ( er ) ;
@@ -142,6 +142,7 @@ const nodeRequest = (type, url, data, config, completeUrl, agent = true) => {
142142 url : completeUrl ? completeUrl : `${ API_URL } /${ url } ` ,
143143 body : data ,
144144 json : config . headers [ 'Content-Type' ] === 'application/json' ,
145+ maxAttempts : 2
145146 } } ;
146147
147148 if ( agent ) {
@@ -515,7 +516,7 @@ exports.batchAndPostEvents = async (eventUrl, kind, data) => {
515516
516517 try {
517518 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();
519520 exports . nodeRequestForLogs ( `[Request Batch Send] for events:uuids ${ eventsUuids } ` )
520521 const response = await nodeRequest ( 'POST' , eventUrl , data , config ) ;
521522 exports . nodeRequestForLogs ( `[Request Batch Repsonse] ${ util . format ( response . data ) } for events:uuids ${ eventsUuids } ` )
0 commit comments