Factor out published/buffer renewal into _runQuery

Fixes the bug when the buffer is empty on the first run if the size of query is more than limit*2