cklogic commited on
Commit
48da9ae
·
1 Parent(s): b835fbc

Fix:After being idle for a while, new tasks need to be cancel and redo (#958)

Browse files

### What problem does this PR solve?

After being idle for a while (When Redis Queue exceeds the
SVR_QUEUE_RETENTION(60*60) expiration time), new tasks need to be cancel
and redo.

When use xgroup_create to create a consumer group, set the ID to "$",
meaning that only messages added to the stream after the group is
created will be visible to new consumers. If the application scenario
requires processing messages that already exist in the queue, you might
need to change this ID to "0", so that the new consumer group can read
all messages from the beginning.


### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)

Files changed (1) hide show
  1. rag/utils/redis_conn.py +1 -1
rag/utils/redis_conn.py CHANGED
@@ -117,7 +117,7 @@ class RedisDB:
117
  self.REDIS.xgroup_create(
118
  queue_name,
119
  group_name,
120
- id="$",
121
  mkstream=True
122
  )
123
  args = {
 
117
  self.REDIS.xgroup_create(
118
  queue_name,
119
  group_name,
120
+ id="0",
121
  mkstream=True
122
  )
123
  args = {