Skip to content

Commit f108795

Browse files
committed
fix: ignore invalid entries from service_usage_monthly
1 parent 193da63 commit f108795

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/backend/src/routers/drivers/usage.js

+8-1
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,15 @@ module.exports = eggspress('/drivers/usage', {
6161
for ( const row of rows ) {
6262
const app = await get_app({ id: row.app_id });
6363

64+
let extra_parsed;
65+
try {
66+
extra_parsed = JSON.parse(row.extra);
67+
} catch ( e ) {
68+
continue;
69+
}
70+
6471
const identifying_fields = {
65-
service: JSON.parse(row.extra),
72+
service: extra_parsed,
6673
year: row.year,
6774
month: row.month,
6875
};

0 commit comments

Comments
 (0)