This repository was archived by the owner on May 20, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
src/bin/inx-chronicle/stardust_inx Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -49,6 +49,8 @@ pub async fn gather_analytics(
49
49
) -> Result < ( ) , InxWorkerError > {
50
50
let mut tasks = JoinSet :: new ( ) ;
51
51
52
+ let len_before = analytics. len ( ) ;
53
+
52
54
for analytic in analytics. drain ( ..) {
53
55
let mongodb = mongodb. clone ( ) ;
54
56
let influxdb = influxdb. clone ( ) ;
@@ -69,6 +71,12 @@ pub async fn gather_analytics(
69
71
analytics. push ( res. unwrap ( ) ?) ;
70
72
}
71
73
74
+ debug_assert_eq ! (
75
+ len_before,
76
+ analytics. len( ) ,
77
+ "The number of analytics should never change."
78
+ ) ;
79
+
72
80
Ok ( ( ) )
73
81
}
74
82
@@ -117,13 +125,16 @@ impl InxWorker {
117
125
118
126
debug ! ( "Started listening to ledger updates via INX." ) ;
119
127
128
+ #[ cfg( feature = "analytics" ) ]
129
+ let mut analytics = chronicle:: db:: collections:: analytics:: all_analytics ( ) ;
130
+
120
131
while let Some ( ledger_update) = stream. try_next ( ) . await ? {
121
132
self . handle_ledger_update (
122
133
& mut inx,
123
134
ledger_update,
124
135
& mut stream,
125
136
#[ cfg( feature = "analytics" ) ]
126
- & mut chronicle :: db :: collections :: analytics:: all_analytics ( ) ,
137
+ & mut analytics,
127
138
)
128
139
. await ?;
129
140
}
You can’t perform that action at this time.
0 commit comments