Skip to content

Commit

Permalink
fix: reduce default delay in task execution and update method signature
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelfreund committed Jan 14, 2025
1 parent fc929c4 commit 6fcad91
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/service/task.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { TaskError } from '../../shared/error/task.error.js';
import { sleep } from '../../shared/lib/util/sleep.util.js';

export class TaskService {
public async run<T>(task: () => Promise<T>, delay: number = 250): Promise<T> {
public async run<T>(task: () => Promise<T>, delay: number = 150): Promise<T> {
await this.convienceDelay(delay);

try {
Expand All @@ -27,7 +27,7 @@ export class TaskService {
}
}

private convienceDelay(wait: number = 500): Promise<unknown> {
private convienceDelay(wait: number): Promise<unknown> {
return sleep(wait);
}
}

0 comments on commit 6fcad91

Please sign in to comment.