Skip to content

Commit

Permalink
chore: remove unused libraries and code
Browse files Browse the repository at this point in the history
  • Loading branch information
regiluze committed Apr 20, 2023
1 parent 95e9624 commit b76d6a8
Show file tree
Hide file tree
Showing 3 changed files with 3,472 additions and 6,609 deletions.
15 changes: 0 additions & 15 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,6 @@ Logsene.prototype.send = function (callback) {
if (options.body === false) {
return
}
var req = null
function httpResult (err, res) {
// if (res && res.body) console.log(res.statusCode, res.body)
var logseneError = null
Expand All @@ -490,9 +489,6 @@ Logsene.prototype.send = function (callback) {
self.emit('x-logsene-error', errObj)

if (self.persistence) {
if (req) {
req.destroy()
}
var storeFileFlag = true
// don't use disk buffer for invalid Logsene tokens
if (res && res.body && appNotFoundRegEx.test(res.body)) {
Expand Down Expand Up @@ -531,21 +527,13 @@ Logsene.prototype.send = function (callback) {

self.emit('log', { source: 'logsene-js', count: count, url: options.url })
delete options.body
if (req && req.destroy) {
req.destroy()
}
if (callback) {
callback(errObj, res)
}
})
.catch(err => {
errObj = { source: 'logsene-js', err: err }
self.emit('x-logsene-error', errObj)

// if (self.persistence && req && req.destroy) {
// req.destroy()
//}

})
}
}
Expand Down Expand Up @@ -587,9 +575,6 @@ Logsene.prototype.shipFile = function (name, data, cb) {
self.emit('file shipped', { file: name, count: options.logCount })
self.emit('rt', { count: options.logCount, source: 'logsene', file: name, url: String(options.url), request: null, response: null })
}
//if (req && req.destroy) {
// req.destroy()
// }
}
fetch(options.url, options)
.then(response => callbackFunc(null, response))
Expand Down
Loading

0 comments on commit b76d6a8

Please sign in to comment.