Skip to content
Snippets Groups Projects
Commit 9323bd3b authored by Robert Latta's avatar Robert Latta
Browse files

corrected redis actions

parent 0a370496
No related branches found
No related tags found
No related merge requests found
......@@ -24,17 +24,16 @@ logger = logging.getLogger(__name__)
@app.task(base=InventoryTask, bind=True, name='update_equipment_locations_ims')
@log_task_entry_and_exit
def update_equipment_locations_ims(self, use_current=False):
r = get_current_redis(InventoryTask.config)
if use_current:
r = get_current_redis(InventoryTask.config)
rp = r.pipeline()
# scan with bigger batches, to mitigate network latency effects
for k in r.scan_iter('ims:location:*', count=1000):
rp.delete(k)
rp.execute()
else:
r = get_next_redis(InventoryTask.config)
rp = r.pipeline()
for k in r.scan_iter('ims:location:*', count=1000):
rp.delete(k)
rp.execute()
c = InventoryTask.config["ims"]
ds = IMS(c['api'], c['username'], c['password'])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment