Skip to content

Commit

Permalink
chore: removed latest epoch from db
Browse files Browse the repository at this point in the history
  • Loading branch information
onmax committed Nov 19, 2024
1 parent d650b3e commit b80e835
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions server/utils/validators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type { Result, ValidatorScore } from './types'
import { readdir, readFile } from 'node:fs/promises'
import path from 'node:path'
import { consola } from 'consola'
import { desc, inArray, isNotNull, max } from 'drizzle-orm'
import { desc, inArray, isNotNull } from 'drizzle-orm'
import { getBrandingParameters } from './branding'
import { defaultValidatorJSON, validatorSchema } from './schemas'

Expand Down Expand Up @@ -141,17 +141,6 @@ export async function fetchValidators(params: FetchValidatorsOptions): Result<Fe
filters.push(sql`lower(${tables.validators.name}) NOT LIKE lower('%Unknown validator%')`)

try {
const latestEpoch = await useDrizzle()
.select({ epochNumber: max(tables.activity.epochNumber) })
.from(tables.activity)
.get()
.then(r => r?.epochNumber)
if (!latestEpoch) {
consola.error('There was an error while fetching the latest epoch')
return { data: undefined, error: 'There was an error while fetching the latest epoch' }
}
consola.info(`Fetching validators for epoch ${latestEpoch}`)

const validators = await useDrizzle()
.select({
id: tables.validators.id,
Expand Down

0 comments on commit b80e835

Please sign in to comment.