Skip to content

Commit 9cc9597

Browse files
committed
Make it easy to see when the last quiz sync's were (and so the next will be) for equipment after loading from cache
1 parent 260655d commit 9cc9597

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/index.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import {createTerminus} from '@godaddy/terminus';
1313
import http from 'http';
1414
import {pipe} from 'fp-ts/lib/function';
1515
import * as TE from 'fp-ts/TaskEither';
16+
import * as O from 'fp-ts/Option';
1617
import {ensureEventTableExists} from './init-dependencies/event-store/ensure-events-table-exists';
1718
import {initDependencies} from './init-dependencies';
1819
import * as libsqlClient from '@libsql/client';
@@ -116,6 +117,15 @@ void (async () => {
116117
)
117118
)
118119
);
120+
for (const equipment of deps.sharedReadModel.equipment.getAll()) {
121+
deps.logger.info(
122+
'After loading cached external events the last quiz sync for equipment %s (%s) was %s (epoch ms)',
123+
equipment.name,
124+
equipment.id,
125+
O.getOrElse<string | number>(() => 'never')(equipment.lastQuizSync)
126+
);
127+
}
128+
119129
await deps.sharedReadModel.asyncApplyExternalEventSources()();
120130

121131
server.listen(conf.PORT, () => {

0 commit comments

Comments
 (0)