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

Possibility to set query timeout ? #18

Open
fijemax opened this issue Dec 18, 2018 · 2 comments
Open

Possibility to set query timeout ? #18

fijemax opened this issue Dec 18, 2018 · 2 comments

Comments

@fijemax
Copy link
Contributor

fijemax commented Dec 18, 2018

Is it possible to set the query timeout on n1ql query ?

@stakach
Copy link
Member

stakach commented Dec 18, 2018

I think the only way to do it is via the connection.

                # Configure 90 second timeouts
                # 0, 1, 13, 15, 61, 93 == operations, views, http, v-bucket poll, n1ql, http pool
                handle = ::User.bucket.connection.handle
                ::Libcouchbase::Ext.cntl_setu32(handle, 0, 90_000_000)
                ::Libcouchbase::Ext.cntl_setu32(handle, 1, 90_000_000)
                ::Libcouchbase::Ext.cntl_setu32(handle, 13, 90_000_000)
                ::Libcouchbase::Ext.cntl_setu32(handle, 15, 90_000_000)
                ::Libcouchbase::Ext.cntl_setu32(handle, 61, 90_000_000)
                ::Libcouchbase::Ext.cntl_setu32(handle, 93, 90_000_000)


                # Configure retries
                # LCB_RETRYOPT_CREATE = Proc.new { |mode, policy| ((mode << 16) | policy) }
                # val = LCB_RETRYOPT_CREATE(LCB_RETRY_ON_SOCKERR, LCB_RETRY_CMDS_SAFE);
                # ::Libcouchbase::Ext.cntl_setu32(handle, LCB_CNTL_RETRYMODE, val)
                retry_config = (1 << 16) | 3
                ::Libcouchbase::Ext.cntl_setu32(handle, 0x24, retry_config)

I should probably make this configurable a little easier at the bucket level.

::User is a couchbase orm model begin used to grab the connection handle

@fijemax
Copy link
Contributor Author

fijemax commented Dec 19, 2018

It work thank you.
Should not this configuration be set in the couchbase.yml file ?

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