Details
-
Bug
-
Resolution: Fixed
-
Critical
-
6.0.0
Description
As per eventing specification for timersĀ
createTimer(callback, date, reference, context)
|
reference
This is a unique string that must be passed in to help identify the timer that is being created. References are always scoped to the function and callback they are used with and need to be unique only within this scope. The call returns the reference string if timer was created successfully. If multiple timers are created with the same unique reference, old timers with the same unique reference are implicitly cancelled. If the reference parameter is set to JavaScript null value, a unique reference will be generated.
|
Observed that with the following handler i am seeing that old timers with same unique reference are not cancelled
function OnUpdate(doc,meta) {
|
var expiry = new Date();
|
expiry.setSeconds(expiry.getSeconds() + 150); var context = {docID : meta.id, random_text : "e6cZZGHuh0R7Aumoe6cZZGHuh0R7Aumoe6cZZGHuh0R7Aumoe6cZZGHuh0R7Aumoe6cZZGHuh0R7Aumoe6cZZGHuh0R7Aumoe6cZZGHuh0R7Aumoe6cZZGHuh0R7Aumoe6cZZGHuh0R7Aumoe6cZZGHuh0R7Aumoe6cZZGHuh0R7Aumoe6cZZGHuh0R7Aumoe6cZZGHuh0R7Aumoe6cZZGHuh07Aumoe6cZZGHuh07Aumoe6cZZGHuh07Aumoe6"};
|
createTimer(timerCallback, expiry, "hello", context);
|
}
|
function timerCallback(context) {
|
dst_bucket[context.docID] = context.random_text;
|
}
|