Skip to content

Commit a1e1d5c

Browse files
committed
fix: mark votes as errored
1 parent 6769013 commit a1e1d5c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/helpers/votesVpValue.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,15 @@ async function refreshVotesVpValues(data: Datum[]) {
3939
const params: any[] = [];
4040

4141
for (const datum of data) {
42+
query.push('UPDATE votes SET vp_value = ?, cb = ? WHERE id = ? LIMIT 1');
43+
4244
try {
4345
const value = getVoteValue(datum.vp_value_by_strategy, datum.vp_by_strategy);
4446

45-
query.push('UPDATE votes SET vp_value = ?, cb = ? WHERE id = ? LIMIT 1');
4647
params.push(value, datum.vp_state === 'final' ? CB.FINAL : CB.PENDING_CLOSE, datum.id);
4748
} catch (e) {
4849
console.log(e);
50+
params.push(0, CB.INELIGIBLE, datum.id);
4951
}
5052
}
5153

0 commit comments

Comments
 (0)