Commit eb1eaee
Ferran Pons Serra
feat(sessions): add public prepare_tables() for eager table initialization
DatabaseSessionService currently initializes database tables lazily on
the first database operation. This causes a noticeable latency spike on
the first user request, which degrades user experience in production
applications.
Add a public `prepare_tables()` method that delegates to the existing
`_prepare_tables()` so that applications can call it at startup time
(e.g. during app initialization or health check) to pay the table-
creation cost upfront.
The lazy behavior is preserved as-is for backward compatibility.1 parent 22fc332 commit eb1eaee
2 files changed
Lines changed: 38 additions & 0 deletions
File tree
- src/google/adk/sessions
- tests/unittests/sessions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
252 | 252 | | |
253 | 253 | | |
254 | 254 | | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
255 | 266 | | |
256 | 267 | | |
257 | 268 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1181 | 1181 | | |
1182 | 1182 | | |
1183 | 1183 | | |
| 1184 | + | |
| 1185 | + | |
| 1186 | + | |
| 1187 | + | |
| 1188 | + | |
| 1189 | + | |
| 1190 | + | |
| 1191 | + | |
| 1192 | + | |
| 1193 | + | |
| 1194 | + | |
| 1195 | + | |
| 1196 | + | |
| 1197 | + | |
| 1198 | + | |
| 1199 | + | |
| 1200 | + | |
| 1201 | + | |
| 1202 | + | |
| 1203 | + | |
| 1204 | + | |
| 1205 | + | |
| 1206 | + | |
| 1207 | + | |
| 1208 | + | |
| 1209 | + | |
| 1210 | + | |
1184 | 1211 | | |
1185 | 1212 | | |
1186 | 1213 | | |
| |||
0 commit comments