diff --git a/server/tasks/analyze.ts b/server/tasks/analyze.ts index 0995000..f9c3fc7 100644 --- a/server/tasks/analyze.ts +++ b/server/tasks/analyze.ts @@ -1,14 +1,16 @@ +import consola from "consola"; + export default defineTask({ meta: { name: "analyze", description: "Update all the statistics", }, async run() { - console.log("Running statistics update"); + consola.log("starting analyze"); - console.time("finish update"); + console.time("finish analyze"); await updateStatistics() - console.timeEnd("finish update"); + console.timeEnd("finish analyze"); return {result: "Success"}; }, diff --git a/server/utils/statistics.ts b/server/utils/statistics.ts index 81516e9..4a3b199 100644 --- a/server/utils/statistics.ts +++ b/server/utils/statistics.ts @@ -1,6 +1,7 @@ import {Stats} from "~/server/utils/types/stats"; import {GameVersion, Version} from "~/server/utils/fetchData"; import {projectTypeList, ProjectTypes} from "~/utils/project"; +import consola from "consola"; type StatsData = Map> type AllStats = { all: Stats, minor: Stats, major: Stats }; @@ -12,6 +13,7 @@ export async function updateStatistics() { } async function updateStatistic(type: ProjectTypes) { + consola.log(`analyzing - ${type}`) const stats = await getStatistics(type) await saveStats(stats, type) } @@ -45,10 +47,7 @@ async function getStatistics(type: ProjectTypes): Promise { } } - console.log("project ids", batchProjectIds.length); - const versionIds = (await getVersionIds(batchProjectIds)) - console.log("version ids", versionIds.length); await analyzeVersionsFromIds(versionIds, data, type); @@ -77,7 +76,6 @@ async function analyzeVersionsFromIds(versionIds: string[], data: StatsData, typ currentIndex += BATCH_SIZE const versions = await getVersions(ids) - console.log("versions", versions.length); analyzeVersions(versions, data, type); if (ids.length != BATCH_SIZE)