Switch to SSDB for message queueing

This commit is contained in:
2022-10-21 07:20:30 +01:00
parent 8c596ec516
commit e32b330ef4
4 changed files with 8 additions and 18 deletions

View File

@@ -36,7 +36,10 @@ class Ingest(object):
items = []
# for source in SOURCES:
# key = f"{KEYPREFIX}{source}"
chunk = await db.ar.zpop(KEYNAME, CHUNK_SIZE)
length = await db.ar.llen(KEYNAME)
start_num = length - CHUNK_SIZE
chunk = await db.ar.lrange(KEYNAME, start_num, -1)
# chunk = await db.ar.rpop(KEYNAME, CHUNK_SIZE)
if not chunk:
return
for item in chunk: