@@ -41,44 +41,37 @@ export class InsightsService {
41
41
}
42
42
43
43
startTimers ( ) {
44
- if (
45
- this . instanceSettings . instanceType !== 'main' &&
46
- this . instanceSettings . instanceType !== 'webhook'
47
- ) {
48
- return ;
49
- }
50
-
51
44
this . collectionService . startFlushingTimer ( ) ;
52
- this . logger . debug ( 'Started collection flushing scheduler ' ) ;
45
+ this . logger . debug ( 'Started flushing timer ' ) ;
53
46
54
47
// Start compaction and pruning timers for main leader instance only
55
48
if ( this . instanceSettings . isLeader ) {
56
- this . startCompactionAndPruningSchedulers ( ) ;
49
+ this . startCompactionAndPruningTimers ( ) ;
57
50
}
58
51
}
59
52
60
53
@OnLeaderTakeover ( )
61
- startCompactionAndPruningSchedulers ( ) {
54
+ startCompactionAndPruningTimers ( ) {
62
55
this . compactionService . startCompactionTimer ( ) ;
63
- this . logger . debug ( 'Started compaction scheduler ' ) ;
56
+ this . logger . debug ( 'Started compaction timer ' ) ;
64
57
if ( this . pruningService . isPruningEnabled ) {
65
58
this . pruningService . startPruningTimer ( ) ;
66
- this . logger . debug ( 'Started pruning scheduler ' ) ;
59
+ this . logger . debug ( 'Started pruning timer ' ) ;
67
60
}
68
61
}
69
62
70
63
@OnLeaderStepdown ( )
71
- stopTimers ( ) {
64
+ stopCompactionAndPruningTimers ( ) {
72
65
this . compactionService . stopCompactionTimer ( ) ;
73
- this . logger . debug ( 'Stopped compaction scheduler ' ) ;
66
+ this . logger . debug ( 'Stopped compaction timer ' ) ;
74
67
this . pruningService . stopPruningTimer ( ) ;
75
- this . logger . debug ( 'Stopped pruning scheduler ' ) ;
68
+ this . logger . debug ( 'Stopped pruning timer ' ) ;
76
69
}
77
70
78
71
@OnShutdown ( )
79
72
async shutdown ( ) {
80
73
await this . collectionService . shutdown ( ) ;
81
- this . stopTimers ( ) ;
74
+ this . stopCompactionAndPruningTimers ( ) ;
82
75
}
83
76
84
77
async getInsightsSummary ( {
0 commit comments