Skip to content
This repository has been archived by the owner on May 30, 2024. It is now read-only.

prepare 4.0.3 release #86

Merged
merged 4 commits into from
Mar 27, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

All notable changes to the LaunchDarkly Node.js SDK will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org).

## [4.0.3] - 2018-03-27
### Fixed
- Fixed a [bug](https://github.com/launchdarkly/node-client/issues/85) that would cause an unhandled promise rejection warning-- and, depending on your Node configuration, a crash-- if there was an HTTP error during an automatic event flush.

## [4.0.2] - 2018-03-14
### Fixed
- In the Redis feature store, fixed synchronization problems that could cause a feature flag update to be missed if several of them happened in rapid succession.
Expand Down
11 changes: 8 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ var new_client = function(sdk_key, config) {
queue = [],
requestor,
update_processor,
event_queue_shutdown = false;
event_queue_shutdown = false,
flush_timer;

config = Object.assign({}, config || {});
config.user_agent = 'NodeJSClient/' + package_json.version;
Expand Down Expand Up @@ -241,6 +242,7 @@ var new_client = function(sdk_key, config) {
update_processor.close();
}
config.feature_store.close();
clearInterval(flush_timer);
}

client.is_offline = function() {
Expand Down Expand Up @@ -334,8 +336,11 @@ var new_client = function(sdk_key, config) {
enqueue(event);
}

// TODO keep the reference and stop flushing after close
setInterval(client.flush.bind(client), config.flush_interval * 1000).unref();
function background_flush() {
client.flush().then(function() {}, function() {});
}

flush_timer = setInterval(background_flush, config.flush_interval * 1000);

return client;
};
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ldclient-node",
"version": "4.0.2",
"version": "4.0.3",
"description": "LaunchDarkly SDK for Node.js",
"main": "index.js",
"scripts": {
Expand Down