-
-
Notifications
You must be signed in to change notification settings - Fork 189
Specify time limit operation on a mongodb cursor #227
Conversation
* @param integer $ms | ||
* @return self | ||
*/ | ||
public function maxTimeMS($ms); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically speaking, yes. This is a BC break and thus would force us to go 2.0. I'm kicking myself now for not catching all methods that were added in the 1.5 driver.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ne0h12: Unfortunately, this needs to be removed. We cannot add new interface methods without bumping a major version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I removed it
@jmikola why Scrutinizer says that checks failed, but when I opening details, then I do not see the errors ? What am i doing wrong ? Thank. |
@ne0h12: I'm not sure what happened with Scrutinizer, but I wouldn't worry too much about it. |
$this->maxTimeMS = (integer)$ms; | ||
$this->mongoCursor->maxTimeMS((integer)$ms); | ||
} | ||
return $this; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ne0h12: The most compatible solution would be to call MongoCursor::addOption('$maxTimeMS', $ms)
here, as it doesn't depend on the driver's method at all.
@alcaeus: Note, I believe this also needs to go into master (it was rightfully opened against it) since we're adding new methods. |
@jmikola I agree. |
Closed manually in 7b4d519. Thanks! |
Termination processing operation if the associated cursor exceeds its allotted time limit. It is beneficial when PHP driver goes on timeout (by default 30 seconds). As a results mongodb keep health on highload projects because of not performing not needed operations.
Thanks. Sorry for my english.