diff --git a/README.md b/README.md index a02cfb2..32b760f 100644 --- a/README.md +++ b/README.md @@ -141,7 +141,7 @@ API - **colddb.add_tag(db,name,tag)** - - + - Creates a folder from the given table in tag. - **colddb.get_or_add_tag(db,name,tag) --> tag_name** diff --git a/colddb.lua b/colddb.lua index 5c1e734..4160430 100644 --- a/colddb.lua +++ b/colddb.lua @@ -384,7 +384,11 @@ local function iterate(db,func_on_iterate,end_func,count,cs,args) extended_api.Async.iterate(db.async_pool,1,count,function(i) local line = fl:read("*l") if args.do_not_skip_removed_items or not db.indexes_pool[cs].deleted_items[line] then - func_on_iterate(line,i,args) + local ar = func_on_iterate(line,i,args) + if ar then + args = ar + return args + end end end,function() if end_func then @@ -454,6 +458,7 @@ function colddb.iterate_index_table(db,begin_func,func_on_iterate,end_func,args, -- Start iterating the index table iterate(db,func_on_iterate,end_func,c,cs,args) elseif f and f.file then + local fl = f.file -- If its iterating some other function then add this one to the queue list fl:seek("set") local c = tonumber(fl:read("*l"))