Closed harald-schafer closed 1 year ago
Thanks @dukefirehawk I think for single connection the implemented solution works. For Pool connections I don't see how to specify the timeout.
@harald-schafer My use case only needed the timeout for single connection hence only implemented for it. As for pooled connections, I think you could add the timeout parameter to MySQLConnectionPool
constructor in the file pool.dart
and then pass it to await conn.connect();
at line 126. Then test out to see if that works for your use case.
Added in 0.0.27. See pool constructor, now it is possible to pass timeout when creating pool
Any call to execute or execute prepared statement that takes longer than 10 seconds will fail with a timeout. Timeout of 10 seconds is hardcoded in various places i.e. in function execute()
// wait for ready state if (_state != _MySQLConnectionState.connectionEstablished) { await _waitForState(_MySQLConnectionState.connectionEstablished) .timeout(Duration(seconds: 10)); }
Would it be please possible to add an optional parameter of type Duration with standard value Duration(seconds: 10) so in case of longer SQL statement user can put a bigger number of seconds than 10. Thanks.