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

Does 'tx.commit()' has timeout feature? #103

Open
dskiranraj opened this issue Dec 4, 2020 · 1 comment
Open

Does 'tx.commit()' has timeout feature? #103

dskiranraj opened this issue Dec 4, 2020 · 1 comment

Comments

@dskiranraj
Copy link

We are using babrahams:transaction library in our project. We have business case where we need to add timeout as part of transaction commit(tx.commit()). If transaction is taking more that x milliseconds to complete all queries to commit, then it should rollback all the changes.

Please let me know whether this can be achieved using babrahams:transaction library? If not, can this be achieved logically in meteor code?

Thanks in advance.

@JackAdams
Copy link
Owner

Hi,
I think it times out and automatically rolls back if the transaction is idle (no new writes) for longer than 5 seconds. You can set this default timeout by changing the 5000 to, say, 2000:

tx.idleTimeout = 5000;

But I don't think there's a way to make the transaction just cut out and roll back everything after a certain amount of time has elasped.
Brent

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

No branches or pull requests

2 participants