function updateBuildStatus(updateConfig, callback) {
    const { redisInstance, status, statusMessage, buildId } = updateConfig;

    return redisInstance.hget(`${queuePrefix}buildConfigs`, buildId)
        .then(JSON.parse)
        .then((fullBuildConfig) => {
            // if fullBuildConfig got deleted already, do not update
            if (!fullBuildConfig) return null;

            return request({
                json: true,
                method: 'PUT',
                uri: `${fullBuildConfig.apiUri}/v4/builds/${buildId}`,
                body: {
                    status,
                    statusMessage
                },
                auth: {
                    bearer: fullBuildConfig.token
                }
            }, (err, response) => {
                if (!err && response.statusCode === 200) {
                    return callback(null);
                }

                return callback(err, response);
            });
        });
}
/**
 * Update build status to FAILURE
 * @method updateBuildStatus
 * @param  {Object}          updateConfig              build config of the job
 * @param  {Function}        [callback]                Callback function
 * @return {Object}          err                       Callback with err object
 */
Update build status to FAILURE
@method updateBuildStatus
@param  {Object}          updateConfig              build config of the job
@param  {Function}        [callback]                Callback function
@return {Object}          err                       Callback with err object
Update build status to FAILURE @method updateBuildStatus @param { Object } updateConfig build config of the job @param { Function } [ callback ] Callback function @return { Object } err Callback with err object
function updateBuildStatus(updateConfig, callback) {
    const { redisInstance, status, statusMessage, buildId } = updateConfig;
    return redisInstance.hget(`${queuePrefix}buildConfigs`, buildId)
        .then(JSON.parse)
        .then((fullBuildConfig) => {
            if (!fullBuildConfig) return null;
            return request({
                json: true,
                method: 'PUT',
                uri: `${fullBuildConfig.apiUri}/v4/builds/${buildId}`,
                body: {
                    status,
                    statusMessage
                },
                auth: {
                    bearer: fullBuildConfig.token
                }
            }, (err, response) => {
                if (!err && response.statusCode === 200) {
                    return callback(null);
                }
                return callback(err, response);
            });
        });
}
function updateBuildStatus ( updateConfig , callback ) { const { redisInstance , status , statusMessage , buildId } = updateConfig ; return redisInstance . hget ( ` ${ queuePrefix } ` , buildId ) . then ( JSON . parse ) . then ( ( fullBuildConfig ) => { if ( ! fullBuildConfig ) return null ; return request ( { json : true , method : 'PUT' , uri : ` ${ fullBuildConfig . apiUri } ${ buildId } ` , body : { status , statusMessage } , auth : { bearer : fullBuildConfig . token } } , ( err , response ) => { if ( ! err && response . statusCode === 200 ) { return callback ( null ) ; } return callback ( err , response ) ; } ) ; } ) ; }
Update build status to FAILURE
 @method updateBuildStatus
 @param  {Object}          updateConfig              build config of the job
 @param  {Function}        [callback]                Callback function
 @return {Object}          err                       Callback with err object
Update build status to FAILURE @method updateBuildStatus @param { Object } updateConfig build config of the job @param { Function } [ callback ] Callback function @return { Object } err Callback with err object
// if fullBuildConfig got deleted already, do not update