Giter VIP home page Giter VIP logo

Comments (8)

zouyx avatar zouyx commented on May 16, 2024

@JimChung0403 该方法为监听值变更的阻塞方法用于自定义值变更后操作。

取得的changeEvent应该是个结构体如下:

···
//config change event
type ChangeEvent struct {
Namespace string
Changes map[string]*ConfigChange
}
···

请问问题中提到的0和1,是获取什么值的时候出现呢?如果是获取changeEvent应该不会出现0和1。

from agollo.

JimChung0403 avatar JimChung0403 commented on May 16, 2024

@zouyx 抱歉, 是我沒說清楚
changeEvent.Changes["nameSpace"].ChangeType

type ConfigChange struct {
OldValue string
NewValue string
ChangeType ConfigChangeType
}

from agollo.

zouyx avatar zouyx commented on May 16, 2024

@JimChung0403 关于ConfigChangeType定义如下

0=ADDED是代表该值是新增的
1=MODIFIED是代表该值是被修改过的

···
const(
ADDED ConfigChangeType=iota
MODIFIED
DELETED
)
···

你的意思是ChangeType=0的状态是不正确的?

from agollo.

JimChung0403 avatar JimChung0403 commented on May 16, 2024

@zouyx
我有時候 修改apollo上面的value (key為舊的)
但 ConfigChangeType 取得是0

不常發生, 但大多發生在一段時間沒使用的“第一次”
第二次以後 都會取得1

from agollo.

zouyx avatar zouyx commented on May 16, 2024

@JimChung0403 我想我知道是什么原因,估计是和#23 引起的

from agollo.

zouyx avatar zouyx commented on May 16, 2024

@JimChung0403 这个问题你也验证一下。

from agollo.

JimChung0403 avatar JimChung0403 commented on May 16, 2024

@zouyx 驗證沒問題了, 謝謝

from agollo.

zouyx avatar zouyx commented on May 16, 2024

好的,我关闭一下,谢谢你的反馈。

from agollo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.