Skip to content

Commit 78250a7

Browse files
Merge pull request #787 from Mark-Simulacrum/bump-db-pool
Increase database connection pool
2 parents e9ba336 + 1cce32e commit 78250a7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/db/mod.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,11 @@ impl Database {
120120

121121
fn new(conn: SqliteConnectionManager, tempfile: Option<NamedTempFile>) -> Fallible<Self> {
122122
let pool = Pool::builder()
123-
.connection_timeout(Duration::from_secs(5))
123+
// By inspection we have 13 threads in production, so make sure each of them can get a
124+
// connection. In practice some of those wouldn't acquire database connections (e.g.,
125+
// the ctrl-c thread) but this seems like a good idea regardless.
126+
.max_size(20)
127+
.connection_timeout(Duration::from_secs(30))
124128
.error_handler(Box::new(ErrorHandler))
125129
.build(conn)?;
126130

0 commit comments

Comments
 (0)