Skip to content

Commit

Permalink
Add socket timeout to query policy
Browse files Browse the repository at this point in the history
Resolves #207
  • Loading branch information
jhecking committed Jul 24, 2017
1 parent 8c38b6d commit 3ca2e93
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 7 deletions.
26 changes: 19 additions & 7 deletions lib/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -1871,20 +1871,32 @@ Client.prototype.updateLogging = function (logConfig) {
*
* A policy affecting the behavior of scan operations.
*
* @property {number} timeout - Maximum time in milliseconds to wait for the operation to complete.
* @property {boolean} failOnClusterChange - Abort the scan if the cluster is not in a stable state.
* @property {boolean} [durableDelete=false] - Specifies whether a {@link
* http://www.aerospike.com/docs/guide/durable_deletes.html|tombstone} should
* be written in place of a record that gets deleted as a result of this
* operation.
* @property {number} [timeout=0] - Maximum time in milliseconds to wait for
* the operation to complete. The default (0) means do not apply a total
* timeout.
* @property {number} [socketTimeout=1000] - Maximum socket idle time in
* milliseconds when processing a database command. Zero means do not apply a
* socket idle timeout.
* @property {boolean} [failOnClusterChange=false] - Abort the scan if the
* cluster is not in a stable state.
* @property {boolean} [durableDelete=false] - If the scan runs a UDF which
* results in a record deletion, leave a {@link
* http://www.aerospike.com/docs/guide/durable_deletes.html|tombstone} for the
* record. This prevents deleted records from reappearing after node failures.
* Valid for Aerospike Server Enterprise Edition only.
*/

/**
* @typedef {Object} Client~QueryPolicy
*
* A policy affecting the behavior of query operations.
*
* @property {number} timeout - Maximum time in milliseconds to wait for the operation to complete.
* @property {number} [timeout=0] - Maximum time in milliseconds to wait for
* the operation to complete. The default (0) means do not apply a total
* timeout.
* @property {number} [socketTimeout=1000] - Maximum socket idle time in
* milliseconds when processing a database command. Zero means do not apply a
* socket idle timeout.
*/

/**
Expand Down
3 changes: 3 additions & 0 deletions src/main/policy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,9 @@ int querypolicy_from_jsobject(as_policy_query* policy, Local<Object> obj, const
if ((rc = get_optional_uint32_property(&policy->timeout, NULL, obj, "timeout", log)) != AS_NODE_PARAM_OK) {
return rc;
}
if ((rc = get_optional_uint32_property(&policy->socket_timeout, NULL, obj, "socketTimeout", log)) != AS_NODE_PARAM_OK) {
return rc;
}
as_v8_detail( log, "Parsing query policy : success");
return AS_NODE_PARAM_OK;
}
Expand Down

0 comments on commit 3ca2e93

Please sign in to comment.