Commit 2fb0bf6
authored
EventIndexer: ensure we add initial checkpoints when the db is first opened (#31448)
* EventIndex: add some documentation
... because comments are not subject to rationing.
* EventIndex: rationalise addInitialCheckpoints logic
* EventIndex: improve logging
* use a single `logger` instance to do the prefixing
* use `JSON.stringify` on the checkpoints so that the rageshakes are useful
* distinguish between logger.warn and logger.debug
* emit some logs if the crawler loop fails
* Move check for empty database to `init`
The problem with checking if the database is empty in `onSync` is that, by the
time we get there, it won't be.
Instead let's remember if the db was empty in `init`, and then once a sync
completes, we can add the checkpoints.
* Some tests for EventIndexer1 parent 3b0bc0b commit 2fb0bf6
File tree
3 files changed
+308
-75
lines changed- src/indexing
- test/unit-tests/indexing
3 files changed
+308
-75
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
| 19 | + | |
18 | 20 | | |
| 21 | + | |
19 | 22 | | |
20 | | - | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
21 | 32 | | |
| 33 | + | |
| 34 | + | |
22 | 35 | | |
23 | 36 | | |
24 | 37 | | |
| |||
0 commit comments