()
| 142 | } |
| 143 | |
| 144 | pub async fn get_sqlite_connection() -> Option<SqlitePool> { |
| 145 | let config = Config::get(); |
| 146 | match config.database.get_sqlite_url() { |
| 147 | Some(url) => SqlitePoolOptions::new() |
| 148 | .max_connections(5) |
| 149 | .connect(&url) |
| 150 | .await |
| 151 | .ok(), |
| 152 | None => None, |
| 153 | } |
| 154 | } |
| 155 | |
| 156 | pub async fn get_redis_connection() -> Option<redis::aio::MultiplexedConnection> { |
| 157 | let config = Config::get(); |
no test coverage detected