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.
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)
(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.