Thanks for you reply, I inserted new documents with TTL 10 min. and wait for 8 mins. but still not created documents in target buckets, I also wait for 10 mins. even my source bucket documents was empty but target buckets don’t have any documents in log as mentioned path not generate specific error . For ref please check eventing code as below:
{
"appname": "add_timer_before_expiry",
"id": 0,
"depcfg": {
"buckets": [{
"alias": "tgt",
"bucket_name": "target"
}, {
"alias": "src",
"bucket_name": "source"
}],
"metadata_bucket": "metadata",
"source_bucket": "source"
},
"appcode": "function OnUpdate(doc, meta) {\n if (meta.expiration > 0 ) //do only for those documents that have a non-zero TTL\n {\n //have to x by 1000, as timestamp in secs; and for Date operations need in milli-secs\n var expiry = new Date(meta.expiration*1000); \n // Compute 2 minutes from the TTL timestamp \n var twoMinsPrior = Math.round(expiry.setMinutes(expiry.getMinutes()-2)/1000); \n log(\"A:\"+twoMinsPrior);\n log(\"B:\"+meta.id)\n docTimer(DocTimerCallback, meta.id, twoMinsPrior); //create the docTimer\n log('Added Doc Timer to DocId:', meta.id);\n }\n}\n\nfunction DocTimerCallback(docid, expiry) {\n log('DocTimerCallback Executed for DocId:', String(docid));\n tgt[docid] = \"To Be Expired Key's Value is:\" + JSON.stringify(src[docid]);\n log('Doc Timer Executed for DocId', String(docid));\n}",
"settings": {
"app_log_max_files": 10,
"app_log_max_size": 10485760,
"breakpad_on": true,
"checkpoint_interval": 10000,
"cleanup_timers": false,
"cpp_worker_thread_count": 2,
"curl_timeout": 500,
"dcp_stream_boundary": "everything",
"deadline_timeout": 3,
"deployment_status": false,
"description": "",
"enable_recursive_mutation": false,
"execution_timeout": 1,
"fuzz_offset": 0,
"lcb_inst_capacity": 5,
"log_level": "TRACE",
"processing_status": false,
"skip_timer_threshold": 86400,
"sock_batch_size": 100,
"tick_duration": 60000,
"timer_processing_tick_interval": 500,
"vb_ownership_giveup_routine_count": 3,
"vb_ownership_takeover_routine_count": 3,
"worker_count": 3,
"worker_queue_cap": 100000,
"xattr_doc_timer_entry_prune_threshold": 100
}
}
This “DocTimerCallback” not called I think issue related to this line “docTimer(DocTimerCallback, meta.id, twoMinsPrior); //create the docTimer”