Mirror of https://github.com/roostorg/coop
github.com/roostorg/coop
1import { inject } from '../../iocContainer/utils.js';
2
3export default inject(
4 [
5 'UserStatisticsService',
6 'getPolicyActionPenaltiesEventuallyConsistent',
7 'closeSharedResourcesForShutdown',
8 'Tracer',
9 ],
10 (
11 userStatsService,
12 getPolicyActionPenalties,
13 sharedResourceShutdown,
14 tracer,
15 ) => ({
16 type: 'Job' as const,
17 async run() {
18 await tracer.addActiveSpan(
19 { resource: 'userScores', operation: 'refreshScoresCache' },
20 async () =>
21 userStatsService.refreshUserScoresCache(getPolicyActionPenalties),
22 );
23 },
24 async shutdown() {
25 await sharedResourceShutdown();
26 },
27 }),
28);