()
| 69 | let interval: number | NodeJS.Timeout; |
| 70 | |
| 71 | const startPolling = () => |
| 72 | (interval = startInterval( |
| 73 | () => |
| 74 | tryCatch(async () => { |
| 75 | const [{d, s, c}] = (await executeCommand( |
| 76 | SELECT + |
| 77 | // eslint-disable-next-line max-len |
| 78 | ` ${DATA_VERSION} d,${SCHEMA_VERSION} s,TOTAL_CHANGES() c FROM ${PRAGMA}${DATA_VERSION} JOIN ${PRAGMA}${SCHEMA_VERSION}`, |
| 79 | )) as [IdObj<number>]; |
| 80 | if (d != dataVersion || s != schemaVersion || c != totalChanges) { |
| 81 | if (!isNullish(dataVersion)) { |
| 82 | listener(); |
| 83 | } |
| 84 | dataVersion = d; |
| 85 | schemaVersion = s; |
| 86 | totalChanges = c; |
| 87 | } |
| 88 | }), |
| 89 | autoLoadIntervalSeconds as number, |
| 90 | )); |
| 91 | |
| 92 | const stopPolling = () => { |
| 93 | dataVersion = schemaVersion = totalChanges = null; |
no test coverage detected
searching dependent graphs…