Skip to content

Commit

Permalink
Question: cambiados algunos metodos a package para test
Browse files Browse the repository at this point in the history
  • Loading branch information
Etihw32 authored Mar 9, 2025
1 parent ad8efe8 commit b20c5ea
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions questions/services/question-db-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export class WikidataQuestion {


export class QuestionDBService {
private pendingPromises: Promise<any>[] = [];
pendingPromises: Promise<any>[] = [];
private questionsCache: Set<Number> = new Set();

private constructor() {
Expand All @@ -47,7 +47,7 @@ export class QuestionDBService {
return this._instance
}

private async resolvePendingPromises() {
async resolvePendingPromises() {
await Promise.all(this.pendingPromises);
this.pendingPromises = []
}
Expand All @@ -64,7 +64,7 @@ export class QuestionDBService {
})
}

private async getRandomEntities(n: number = 1) : Promise<WikidataEntity[]> {
async getRandomEntities(n: number = 1) : Promise<WikidataEntity[]> {

const MAX_ITERATIONS = 3;
let n_iterations = 0;
Expand Down Expand Up @@ -98,7 +98,7 @@ export class QuestionDBService {
return await Question.countDocuments()
}

private async generateQuestions(n: number) : Promise<Question[]> {
async generateQuestions(n: number) : Promise<Question[]> {
console.log("Generating a batch of " + n + " questions")

const query = new WikidataQueryBuilder()
Expand Down

0 comments on commit b20c5ea

Please sign in to comment.