()
| 194 | } |
| 195 | |
| 196 | async function inspectSessionEndClaims() { |
| 197 | const redis = getRedisCache(); |
| 198 | let cursor = '0'; |
| 199 | let count = 0; |
| 200 | do { |
| 201 | const [next, batch] = await redis.scan( |
| 202 | cursor, |
| 203 | 'MATCH', |
| 204 | 'session:end:emitted:*', |
| 205 | 'COUNT', |
| 206 | 1000 |
| 207 | ); |
| 208 | cursor = next; |
| 209 | count += batch.length; |
| 210 | } while (cursor !== '0' && count < 100_000); |
| 211 | return count; |
| 212 | } |
| 213 | |
| 214 | async function sampleOldestSession( |
| 215 | projectId: string, |