Two fixes for luamongo #19

merged 2 commits into from Apr 18, 2012

2 participants


I was trying to use LuaMongo in my Nginx environment, and I realized that I wanted to change the timeout (to prevent Nginx from being blocked by a slow lookup), but the timeout didn't seem to change. A quick glance at the source code indicated that the timeout wasn't ever being set based on the docs. The docs were right that you were trying to coerce the timeout to an integer, despite the fact that MongoDB accepts a double. But even the int you were reading was never getting set, because of a shadowed stack variable.

The docs were wrong about the parameters being parameters too (they were actually table values), though I changed that on the Wiki. Ideally if this gets accepted into luamongo the docs will get updated to show that it takes a double now.

Other than that, luamongo is showing me some really fast write action from Nginx/LuaJit, which is great. Not sure if Matt is reading these comments, but thanks Matt for pointing me at this.


Tim Mensch added some commits Apr 11, 2012
Tim Mensch Fixed timeout to be a double, as MongoDB expects, and to ACTUALLY BE …
…USED, since the previous int was shadowing a parameter by the same name

(cherry picked from commit b2cd2ed)
Tim Mensch Initialize rw_timeout
(cherry picked from commit b8827d8)

Would this change prevent the driver from working against versions of the mongo client that use an int for the timeout? (v 1.5 I think)


It might cause a build warning, but C++ should convert a double to an int without an error.

@larubbio larubbio merged commit db2547f into moai:master Apr 18, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment