This repository has been archived by the owner on Jun 20, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 32
mark all as complete時のバグ #68
Labels
Comments
ttps://github.com/rails/rails/issues/11118 railsのバグ? |
http://alco.dk/blogs/dodge_nomethoderror 別Threadでコネクション張らないといけないぽい |
無限loopに陥る可能性があるので酷いコードですけど、こんな感じにrescue書いても、大丈夫でした。 def transaction(todo)
if todo.valid?
begin
yield
rescue
transaction(todo){ yield }
end
else
json_halt 400, message: todo.errors.messages
end
end で、 transaction(todo) do
todo.save!
response.status = 200
json todo
end |
このパターンもあった 😱 timeoutの時間を長くすると、こっちが出る。
|
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
5個程度以上のtodoに対して、mark all as completeをやるとsqliteにロックがかかって、500になります。
The text was updated successfully, but these errors were encountered: