Harden worker polling and dashboard writes
This commit is contained in:
parent
0af88eec6e
commit
98d576d5ce
3 changed files with 34 additions and 4 deletions
|
|
@ -102,9 +102,9 @@ async function main(): Promise<void> {
|
|||
);
|
||||
providerRegistry = await buildProviderRegistry(systemMessages);
|
||||
console.log(`VoidBot worker polling every ${config.workerPollIntervalMs}ms.`);
|
||||
await processPendingJobs();
|
||||
await pollPendingJobs();
|
||||
setInterval(() => {
|
||||
void processPendingJobs();
|
||||
void pollPendingJobs();
|
||||
}, config.workerPollIntervalMs);
|
||||
}
|
||||
|
||||
|
|
@ -131,6 +131,16 @@ async function processPendingJobs(): Promise<void> {
|
|||
}
|
||||
}
|
||||
|
||||
async function pollPendingJobs(): Promise<void> {
|
||||
try {
|
||||
await processPendingJobs();
|
||||
} catch (error) {
|
||||
const message =
|
||||
error instanceof Error ? `${error.name}: ${error.message}` : "Unexpected worker poll failure.";
|
||||
console.error(`Worker poll failed: ${message}`);
|
||||
}
|
||||
}
|
||||
|
||||
async function buildProviderRegistry(systemMessagesCatalog: SystemMessageCatalog): Promise<ProviderRegistry> {
|
||||
return new ProviderRegistry([
|
||||
new OwnerCodexProvider({
|
||||
|
|
|
|||
Loading…
Reference in a new issue