You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found that I cannot add elements to a list using lpush when using this component in the Nestjs project.
我在nestjs项目中使用该组件时发现无法使用 lpush向列表中添加元素。
I implemented a message queue using a list in Nestjs
我在nestjs中使用list实现了一个消息队列
Finally used in the project's service
最后在项目的service中使用
importRedisfrom'ioredis';import{InjectRedis}from'@nestjs-modules/ioredis';
@Resolver('Article')exportclassArticleResolver{privatelogger=newLogger(ArticleResolver.name);constructor(
@InjectRedis()privatereadonlyredis: Redis,){}asyncmethod(tid){// The execution of the following line of code is blocked and cannot returnawaitthis.redis.lpush("bff_msg_queue",JSON.stringify({"event": "update_article_info","tid": tid}));}}
When I call the method() method, the execution keeps waiting for lpush to complete, and the program does not continue to execute.
当我调用 method() 方法的时候,执行一直在等待lpush执行完成,程序不在往下执行。
The text was updated successfully, but these errors were encountered:
Just a quick hunch, but could it be because brpop is blocking, and then the same client cannot do the lpush? Also, cacheRefreshHandler (and the blocking) is not awaited in onApplicationBootstrap.
I found that I cannot add elements to a list using lpush when using this component in the Nestjs project.
我在nestjs项目中使用该组件时发现无法使用 lpush向列表中添加元素。
I implemented a message queue using a list in Nestjs
我在nestjs中使用list实现了一个消息队列
项目启动时:
Finally used in the project's service
最后在项目的service中使用
When I call the method() method, the execution keeps waiting for lpush to complete, and the program does not continue to execute.
当我调用 method() 方法的时候,执行一直在等待lpush执行完成,程序不在往下执行。
The text was updated successfully, but these errors were encountered: