Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clear timerFunctionForBufferedLogs if not needed #14

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Clear timerFunctionForBufferedLogs if not needed

This is an example of a fix for loggly/winston-loggly-bulk#12 with a small amount of code change.

Note that these lines:
```
    if (timerFunction === null) {
      timerFunction = setInterval(function () {
        sendBulkLogs();
      },30000);
    }
```

produce the same bug when `isBulk` is `true`. See loggly/winston-loggly-bulk#13
  • Loading branch information
btamayo committed Aug 12, 2017
commit 64561b1576730a2b9b8f2bb3fb9c08497c7eead8
@@ -222,8 +222,11 @@ common.loggly = function () {
//
if (timerFunctionForBufferedLogs === null) {
timerFunctionForBufferedLogs = setInterval(function () {
if (arrBufferedMsg.length) sendBufferdLogstoLoggly();
if (arrBufferedMsg.length) { sendBufferdLogstoLoggly(); }
}, bufferOptions.retriesInMilliSeconds);
} else if (timerFunctionForBufferedLogs && !arrBufferedMsg.length) {
clearInterval(timerFunctionForBufferedLogs);
timerFunctionForBufferedLogs = null;
}


ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.