diff --git a/synapse/lib/layer.py b/synapse/lib/layer.py index 6a319085f7..644e415bdc 100644 --- a/synapse/lib/layer.py +++ b/synapse/lib/layer.py @@ -2689,10 +2689,11 @@ async def syncIndexEvents(self, offs, matchdef, wait=True): yield (curoff, (buid, form, etyp, vals, meta)) + await asyncio.sleep(0) + count += 1 if count % 1000 == 0: yield (curoff, (None, None, EDIT_PROGRESS, (), ())) - await asyncio.sleep(0) async def makeSplices(self, offs, nodeedits, meta, reverse=False): ''' diff --git a/synapse/tests/test_cortex.py b/synapse/tests/test_cortex.py index c31c3c04ae..858d989fe8 100644 --- a/synapse/tests/test_cortex.py +++ b/synapse/tests/test_cortex.py @@ -4968,15 +4968,15 @@ async def test_cortex_syncindexevents(self): self.eq(expectadd, item4) # Make sure progress every 1000 layer log entries works - await core.nodes('[inet:ipv4=192.168.1/22]') + await core.nodes('[inet:ipv4=192.168.1/20]') offsdict = {baselayr.iden: baseoffs + 1, layriden: baseoffs + 1} items = await alist(proxy.syncIndexEvents(mdef, offsdict=offsdict, wait=False)) - expect = (baseoffs + 5 + 1000, baselayr.iden, s_cortex.SYNC_NODEEDIT, + expect = (9999, baselayr.iden, s_cortex.SYNC_NODEEDIT, (None, None, s_layer.EDIT_PROGRESS, (), ())) - self.eq(expect, items[1]) + self.eq(expect[1:], items[1][1:]) # Make sure that genr wakes up if a new layer occurs after it is already waiting offs = await core.getNexsIndx()