Browse Source

wip:提交nsq配置

wangkaiyue 3 năm trước cách đây
mục cha
commit
4bdf7fff3c
2 tập tin đã thay đổi với 5 bổ sung4 xóa
  1. 4 3
      etc/config.yaml
  2. 1 1
      main.go

+ 4 - 3
etc/config.yaml

@@ -13,8 +13,9 @@ etcd:
 
 #消息队列
 nsq:
-  #address: 192.168.3.207:4161
+  topic: jy_event
   address: 123.56.53.97:4161
+  channel: event
 
 #数据库配置
 databases:
@@ -72,8 +73,8 @@ bidderPlan: # 临时活动
   name: 投标人专属免费计划
   code: bidderFreePlan
   dateRange: #活动时间
-    st: 2022-05-01
-    ed: 2022-06-01
+    st: 2022-05-01 12:00:00
+    ed: 2022-06-01 9:00:00
   missions: #任务列表
     subscribe: #订阅
       points: 300

+ 1 - 1
main.go

@@ -22,7 +22,7 @@ func init() {
 func nsqWork() {
 	// Instantiate a consumer that will subscribe to the provided channel.
 	config := nsq.NewConfig()
-	consumer, err := nsq.NewConsumer("jy_event", "event", config)
+	consumer, err := nsq.NewConsumer("jy_event", gcfg.Instance().MustGet(gctx.New(), "nsq.channel", "event").String(), config)
 	if err != nil {
 		log.Fatal(err)
 	}