Skip to content

Commit

Permalink
Start the polling right away the startClientPolling is called
Browse files Browse the repository at this point in the history
  • Loading branch information
agajdosi committed Nov 29, 2024
1 parent 9521e79 commit 6c4111a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,15 @@ async function startClientPolling(interval: number = 5000, verbosity: Verbosity
return;
}

try { // Start polling right away
connectedClients = await getClientsNow();
console.log("Updated clients:", connectedClients);
} catch (error) {
if (verbosity > 0) {
console.error("Error while fetching clients (immediate):", error);
}
}

pollingInterval = setInterval(async () => {
try {
connectedClients = await getClientsNow();
Expand Down

0 comments on commit 6c4111a

Please sign in to comment.