ccinn

Results 3 issues of ccinn

Examples of helping people use cobra more intuitively ,resolve https://github.com/manifoldco/promptui/issues/56

##### 使用的Orange版本 v0.7.0 ##### 需求或场景 我最近在优化consul_balancer的功能,看到一些代码有一些疑惑,希望得到解答。 我看consul_balancer插件中的一段代码,有一个_watch方法,里面有一个`while t do`的循环体,实际去检测服务健康的方法是在内部的` _check(service_descriptor, service_index)`方法,这样子一来岂不是,一直在发起http请求去检测?不知道之前设计这个插件的时候,是不是故意这样子处理的,在我看来可能定期发起健康检查是不是会好一些?还是说我考虑多余了? 假设我考虑是多余的,那么为什么还要加上一段代码: ``` local tNow = ostime() if tNow > tLast then _timer(0, _watch, service_descriptor) return end ``` 上面这段代码,难道不是应该为了控制请求频率而存在的吗? #####...

snowflake 算法最高位不用,所以毫秒计时器用了41个bit,所以最多是2^42 -1,就相当于139年,如果你是用了42个bit的话,那么应该是2^43 -1。就相当于278年了。