fix: Fix missing await on stagger mapper initial sleep

This commit is contained in:
FoxxMD 2026-04-22 13:40:29 +00:00
parent 981805aa96
commit 4caf1c8cdb
2 changed files with 2 additions and 2 deletions

View file

@ -18,7 +18,7 @@ import { parseVersion } from "./version.js";
import { initServer } from "./server/index.js";
import { createHeartbeatClientsTask } from "./tasks/heartbeatClients.js";
import { createHeartbeatSourcesTask } from "./tasks/heartbeatSources.js";
import { isDebugMode, parseBool, retry, sleep } from "./utils.js";
import { isDebugMode, parseBool, retry } from "./utils.js";
import { readJson } from './utils/DataUtils.js';
//import { createVegaGenerator } from './utils/SchemaUtils.js';
import ScrobbleClients from './scrobblers/ScrobbleClients.js';

View file

@ -62,7 +62,7 @@ export function staggerMapper<Element, NewElement>(options: StaggerOptions) {
return (mapper: Mapper<Element, NewElement>) => async (x: Element, index: number) => {
if (index < concurrency) {
sleep(initialStagger);
await sleep(initialStagger);
initialStagger += initialInterval;
} else {
const s = Math.min((Math.random() * 1000), maxRandomStagger)