我通过引入请求和响应模型来重构我的控制器,以便在演示之后执行一些挂在控制器周围的逻辑.我将所有响应和请求模型分别包含模块响应和请求.应用程序运行完美,但是当我运行测试时,我得到以下错误.
Failure/Error: Unable to find matching line from backtrace
RuntimeError:
Circular dependency detected while autoloading constant Responses::FolderContentResponse
Run Code Online (Sandbox Code Playgroud)
我的目录结构如下:
- app/
- models/
- responses /
注意:我已经看到了与此问题相关的问题,但是,他们的问题似乎与我的问题不相似.在我的情况下,它是随机发生的,只有在运行测试(RAILS TEST ENV)时,应用程序才能正常运行.
module Responses
class ContentResponse
include ActiveAttr::Model
#some attributes
#some methods
end
end
module Responses
class FolderContentResponse < ContentResponse
end
end
Run Code Online (Sandbox Code Playgroud)
FolderContent响应类继承自ContentResponse,后者具有FolderContent其他内容响应使用的更通用的方法.
我遇到一个问题,当 hystrix 断路器跳闸时,它不会再次关闭。我已将日志记录转为调试,并且我没有看到它试图允许测试请求通过,在这种情况下,在我看来它永远不会关闭,因为它只有在测试执行成功完成时才应该关闭,表明有问题的服务现在是健康。根据文档,断路器配置默认值应该可以工作,但我似乎无法说出为什么测试请求永远不会被允许通过。
2016-02-18 09:00:38,782 noodle-soup-service application-akka.actor.default-dispatcher-7 ERROR akka.actor.OneForOneStrategy - CallServiceCommand short-circuited and fallback failed.
com.netflix.hystrix.exception.HystrixRuntimeException: CallServiceCommand short-circuited and fallback failed.
at com.netflix.hystrix.AbstractCommand$16.call(AbstractCommand.java:816) ~[com.netflix.hystrix.hystrix-core-1.4.23.jar:1.4.23]
at com.netflix.hystrix.AbstractCommand$16.call(AbstractCommand.java:790) ~[com.netflix.hystrix.hystrix-core-1.4.23.jar:1.4.23]
at rx.internal.operators.OperatorOnErrorResumeNextViaFunction$1.onError(OperatorOnErrorResumeNextViaFunction.java:99) ~[io.reactivex.rxjava-1.1.0.jar:1.1.0]
at rx.internal.operators.OperatorDoOnEach$1.onError(OperatorDoOnEach.java:71) ~[io.reactivex.rxjava-1.1.0.jar:1.1.0]
...
Caused by: java.lang.RuntimeException: Hystrix circuit short-circuited and is OPEN
at com.netflix.hystrix.AbstractCommand$1.call(AbstractCommand.java:414) ~[com.netflix.hystrix.hystrix-core-1.4.23.jar:1.4.23]
... 38 common frames omitted
Run Code Online (Sandbox Code Playgroud) 我是emacs和emacs-lisp的新手,所以我不知道如何编写emacs的扩展,但是我遇到了像'pretty-lambdas'这样的强大扩展
(lambda (x) (+ x x)) ----> (? (x) (+ x x))
Run Code Online (Sandbox Code Playgroud)
在emacs-lisp模式下.我能够使它适用于clojure,这样我得到:
(fn [x] (+ x x)) -----> (? [x] (+ x x))
Run Code Online (Sandbox Code Playgroud)
我想对javascript做同样的事情,这样在javascript模式而不是
function(x){}
Run Code Online (Sandbox Code Playgroud)
我明白了 f(x){}
我该如何实现这一目标?谢谢.
akka ×1
elisp ×1
emacs ×1
hystrix ×1
java ×1
javascript ×1
rspec-rails ×1
ruby ×1
scala ×1
web ×1