From 29240aa30cb17e015d0d3983d012f1dcde6dff42 Mon Sep 17 00:00:00 2001 From: Syphax Bouazzouni Date: Wed, 16 Mar 2022 14:51:39 +0100 Subject: [PATCH] remove redis deprecated commands warning --- lib/ncbo_annotator.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/ncbo_annotator.rb b/lib/ncbo_annotator.rb index ddd53ef3..e87680ab 100644 --- a/lib/ncbo_annotator.rb +++ b/lib/ncbo_annotator.rb @@ -465,12 +465,13 @@ def annotate_direct(text, options={}) redis_data = Hash.new cur_inst = redis_current_instance() - redis.pipelined { + redis.pipelined do |pipeline| rawAnnotations.each do |ann| id = get_prefixed_id(cur_inst, ann.string_id) - redis_data[id] = { future: redis.hgetall(id) } + redis_data[id] = { future: pipeline.hgetall(id) } end - } + end + sleep(1.0 / 150.0) redis_data.each do |k, v| while v[:future].value.is_a?(Redis::FutureNotReady)