Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Global timeouts using before query hooks #341

Merged
merged 4 commits into from
Oct 19, 2023
Merged

Conversation

abnegate
Copy link
Member

What's Changed

Allow using instance level query hooks to set timeout per database event (or all)

Test Plan

Existing tests, updated timeout test

{
if ($this->getDatabase()->getAdapter()->getSupportForTimeouts()) {
static::getDatabase()->createCollection('global-timeouts');
$this->assertEquals(true, static::getDatabase()->createAttribute('global-timeouts', 'longtext', Database::VAR_STRING, 100000000, true));

for ($i = 0 ; $i <= 5 ; $i++) {
for ($i = 0 ; $i <= 20 ; $i++) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had to change this otherwise tests were failing, not sure if it's local to me, seems to be a performance win so not worried.

Context: loop iterations determine how many huge documents to insert to force a timeout when querying them

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can make the text in the file little longer, maybe will help to get a timeout

Copy link
Contributor

@christyjacob4 christyjacob4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tiny comment

@abnegate abnegate merged commit 591cadb into main Oct 19, 2023
3 checks passed
@abnegate abnegate deleted the feat-global-timeouts branch November 23, 2023 01:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants